Add BrowserWindow.getFocusedWindow() API.
This commit is contained in:
parent
5c3857790c
commit
394bf0a8d9
2 changed files with 7 additions and 0 deletions
|
@ -1,6 +1,11 @@
|
|||
EventEmitter = require('events').EventEmitter
|
||||
objectsRegistry = require '../../atom/objects_registry.js'
|
||||
|
||||
BrowserWindow = process.atomBinding('window').BrowserWindow
|
||||
BrowserWindow.prototype.__proto__ = EventEmitter.prototype
|
||||
|
||||
BrowserWindow.getFocusedWindow = ->
|
||||
windows = objectsRegistry.getAllWindows()
|
||||
return window for window in windows when window.isFocused()
|
||||
|
||||
module.exports = BrowserWindow
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue