Merge branch 'maximize-on-autostart'

Close #419
This commit is contained in:
Yuya Ochiai 2017-01-23 21:02:27 +09:00
commit 3c81c39ed2
2 changed files with 13 additions and 5 deletions

View file

@ -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"
----

View file

@ -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.