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" ---- diff --git a/src/main.js b/src/main.js index ec485bb3..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') { @@ -484,14 +488,16 @@ app.on('ready', () => { mainWindow.setFullScreenable(true); // fullscreenable option has no effect. if (hideOnStartup) { - 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.