From 0834313456e91d9ada1e6773f9393026e24eb99e Mon Sep 17 00:00:00 2001 From: Baptiste Augrain Date: Thu, 16 Aug 2018 01:06:13 +0200 Subject: [PATCH] restore window position --- lib/main-window.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/main-window.js b/lib/main-window.js index a6d129fc..fa54d5ce 100644 --- a/lib/main-window.js +++ b/lib/main-window.js @@ -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, @@ -59,6 +61,7 @@ if (process.platform === 'darwin') { } mainWindow.on('resize', _.throttle(storeWindowSize, 500)) +mainWindow.on('move', _.throttle(storeWindowSize, 500)) function storeWindowSize () { try {