Emit browser-window-created when window is created

This commit is contained in:
Cheng Zhao 2015-09-14 17:02:24 +08:00
parent 9e7b67802c
commit c346fcb326

View file

@ -45,6 +45,9 @@ BrowserWindow::_init = ->
@on 'focus', (event) =>
app.emit 'browser-window-focus', event, this
# Notify the creation of the window.
app.emit 'browser-window-created', {}, this
BrowserWindow.getFocusedWindow = ->
windows = BrowserWindow.getAllWindows()
return window for window in windows when window.isFocused()