From d89829502ccd9d624e14d0ff11352136ab1a8359 Mon Sep 17 00:00:00 2001 From: Yuya Ochiai Date: Sun, 22 Jan 2017 19:27:59 +0900 Subject: [PATCH 1/3] Restore maximized window state on autostart --- src/main.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.js b/src/main.js index ec485bb3..792375c8 100644 --- a/src/main.js +++ b/src/main.js @@ -484,6 +484,9 @@ app.on('ready', () => { mainWindow.setFullScreenable(true); // fullscreenable option has no effect. if (hideOnStartup) { + if (windowOptions.maximized) { + mainWindow.maximize(); + } mainWindow.minimize(); } else { if (windowOptions.maximized) { From 490772a4dadbb2b66cae43feaeb0b71c84704340 Mon Sep 17 00:00:00 2001 From: Yuya Ochiai Date: Sun, 22 Jan 2017 19:58:42 +0900 Subject: [PATCH 2/3] Tweak autostart for MacOS --- src/main.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/main.js b/src/main.js index 792375c8..38d7f3a4 100644 --- a/src/main.js +++ b/src/main.js @@ -455,7 +455,11 @@ app.on('ready', () => { }); mainWindow = new BrowserWindow(windowOptions); mainWindow.once('ready-to-show', () => { - mainWindow.show(); + if (process.platform !== 'darwin') { + mainWindow.show(); + } else if (hideOnStartup !== true) { + mainWindow.show(); + } }); if (process.platform === 'darwin') { @@ -487,14 +491,13 @@ app.on('ready', () => { if (windowOptions.maximized) { mainWindow.maximize(); } - mainWindow.minimize(); - } else { - if (windowOptions.maximized) { - mainWindow.maximize(); - } - if (windowOptions.fullscreen) { - mainWindow.setFullScreen(true); + + // on MacOS, the window is already hidden until 'ready-to-show' + if (process.platform !== 'darwin') { + mainWindow.minimize(); } + } else if (windowOptions.maximized) { + mainWindow.maximize(); } // and load the index.html of the app. From 56c98104637544573d2301d91b32e026e9473fdf Mon Sep 17 00:00:00 2001 From: Yuya Ochiai Date: Sun, 22 Jan 2017 20:29:31 +0900 Subject: [PATCH 3/3] Update README.md for autostart --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b39c30c..77f68acf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,9 +26,11 @@ Release date: TBD #### Windows - Fixed an issue where an unexpected window appears while install/uninstalling +- Fixed an issue where the maximized state is not restored when the application is started by "Start app on Login" #### Linux - Fixed missing initial theme of tray icon +- Fixed an issue where the maximized state is not restored when the application is started by "Start app on Login" ----