Skip to content

Commit

Permalink
Merge pull request webtorrent#493 from feross/fix-screen
Browse files Browse the repository at this point in the history
Remove require('screen')
  • Loading branch information
feross committed May 12, 2016
2 parents 2085312 + 5dd5e86 commit 969ad64
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 969ad64

Please sign in to comment.