2016-05-15 13:41:30 +00:00
|
|
|
const {EventEmitter} = require('events')
|
2018-03-06 00:45:51 +00:00
|
|
|
const {deprecate} = require('electron')
|
2016-08-02 11:38:35 +00:00
|
|
|
const {screen, Screen} = process.atomBinding('screen')
|
2016-01-12 02:40:23 +00:00
|
|
|
|
2017-11-02 04:05:27 +00:00
|
|
|
// Screen is an EventEmitter.
|
2016-08-02 11:38:35 +00:00
|
|
|
Object.setPrototypeOf(Screen.prototype, EventEmitter.prototype)
|
2017-11-02 04:05:27 +00:00
|
|
|
EventEmitter.call(screen)
|
2016-01-12 02:40:23 +00:00
|
|
|
|
2018-03-06 00:45:51 +00:00
|
|
|
const nativeFn = screen.getMenuBarHeight
|
|
|
|
screen.getMenuBarHeight = function () {
|
|
|
|
if (!process.noDeprecations) {
|
|
|
|
deprecate.warn('screen.getMenuBarHeight', 'screen.getPrimaryDisplay().workArea')
|
|
|
|
}
|
|
|
|
return nativeFn.call(this)
|
|
|
|
}
|
|
|
|
|
2016-03-24 20:15:04 +00:00
|
|
|
module.exports = screen
|