Remove require('screen')

This is deprecated usage and was just removed in Electron v1.
This commit is contained in:
Feross Aboukhadijeh
2016-05-12 16:57:09 -07:00
parent 2085312c34
commit 5dd5e8661b

View File

@@ -196,8 +196,7 @@ function setBounds (bounds, maximize) {
log('setBounds: setting bounds to ' + JSON.stringify(bounds))
if (bounds.x === null && bounds.y === null) {
// X and Y not specified? By default, center on current screen
var screen = require('screen')
var scr = screen.getDisplayMatching(windows.main.getBounds())
var scr = electron.screen.getDisplayMatching(windows.main.getBounds())
bounds.x = Math.round(scr.bounds.x + scr.bounds.width / 2 - bounds.width / 2)
bounds.y = Math.round(scr.bounds.y + scr.bounds.height / 2 - bounds.height / 2)
log('setBounds: centered to ' + JSON.stringify(bounds))