electron/browser/api/lib/browser_window.coffee
2013-05-16 23:00:43 +08:00

11 lines
400 B
CoffeeScript

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