Fix mainWindow state not managed properly

Need to call manage `mainWindowState.manage(mainWindow)` immediately instead of at the end of `createMainWindow()`, if not certain changes such as maximizing the main window before it has been registered will not be saved.
This commit is contained in:
Jia Hao 2016-03-25 21:06:59 +08:00
parent e7390b9e33
commit d020d5d659
1 changed files with 2 additions and 1 deletions

View File

@ -46,6 +46,8 @@ function createMainWindow(options, onAppQuit, setDockBadge) {
fullscreen: options.fullScreen || undefined
});
mainWindowState.manage(mainWindow);
// after first run, no longer force full screen to be true
if (options.fullScreen) {
options.fullScreen = undefined;
@ -170,7 +172,6 @@ function createMainWindow(options, onAppQuit, setDockBadge) {
maybeHideWindow(mainWindow, event);
});
mainWindowState.manage(mainWindow);
return mainWindow;
}