Skip to content

Commit

Permalink
Remove require('screen')
Browse files Browse the repository at this point in the history
This is deprecated usage and was just removed in Electron v1.
  • Loading branch information
feross committed May 12, 2016
1 parent 2085312 commit 5dd5e86
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions main/ipc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 5dd5e86

Please sign in to comment.