From: Prince J Wesley Date: Mon, 11 Jan 2016 07:18:35 +0000 (+0530) Subject: Return null for no focused window when calling BrowserWindow.getFocusedWindow() X-Git-Tag: v0.36.4~22^2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=018ae5189bb3b5c9bfb90f06a0738a5265eee031;p=electron.git Return null for no focused window when calling BrowserWindow.getFocusedWindow() --- diff --git a/atom/browser/api/lib/browser-window.coffee b/atom/browser/api/lib/browser-window.coffee index 92a230ba..aa3bd022 100644 --- a/atom/browser/api/lib/browser-window.coffee +++ b/atom/browser/api/lib/browser-window.coffee @@ -66,6 +66,7 @@ BrowserWindow::_init = -> BrowserWindow.getFocusedWindow = -> windows = BrowserWindow.getAllWindows() return window for window in windows when window.isFocused() + null BrowserWindow.fromWebContents = (webContents) -> windows = BrowserWindow.getAllWindows() diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index 8fb64b56..c4df2887 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -287,7 +287,7 @@ Returns an array of all opened browser windows. ### `BrowserWindow.getFocusedWindow()` -Returns the window that is focused in this application. +Returns the window that is focused in this application, otherwise returns `null`. ### `BrowserWindow.fromWebContents(webContents)`