Return null for no focused window when calling BrowserWindow.getFocusedWindow()
authorPrince J Wesley <princejohnwesley@gmail.com>
Mon, 11 Jan 2016 07:18:35 +0000 (12:48 +0530)
committerPrince J Wesley <princejohnwesley@gmail.com>
Mon, 11 Jan 2016 07:28:44 +0000 (12:58 +0530)
atom/browser/api/lib/browser-window.coffee
docs/api/browser-window.md

index 92a230b..aa3bd02 100644 (file)
@@ -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()
index 8fb64b5..c4df288 100644 (file)
@@ -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)`