Skip to content

Commit

Permalink
Merge pull request #2302 from daiyam/window-position
Browse files Browse the repository at this point in the history
restore window position
  • Loading branch information
Rokt33r committed Aug 20, 2018
2 parents 736106b + 0834313 commit eeb8016
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/main-window.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ const config = new Config()
const _ = require('lodash')

var showMenu = process.platform !== 'win32'
const windowSize = config.get('windowsize') || { width: 1080, height: 720 }
const windowSize = config.get('windowsize') || { x: null, y: null, width: 1080, height: 720 }

const mainWindow = new BrowserWindow({
x: windowSize.x,
y: windowSize.y,
width: windowSize.width,
height: windowSize.height,
minWidth: 500,
Expand Down Expand Up @@ -59,6 +61,7 @@ if (process.platform === 'darwin') {
}

mainWindow.on('resize', _.throttle(storeWindowSize, 500))
mainWindow.on('move', _.throttle(storeWindowSize, 500))

function storeWindowSize () {
try {
Expand Down

0 comments on commit eeb8016

Please sign in to comment.