Skip to content

Commit

Permalink
Use normal bounds when saving the window state
Browse files Browse the repository at this point in the history
This means the window state is correctly saved, even if the window is minimized or maximized when logging out or exiting the app.

electron/electron#13290
  • Loading branch information
sindresorhus committed Dec 20, 2018
1 parent d30029c commit 70ef052
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/index.js
Expand Up @@ -163,7 +163,7 @@ app.on('window-all-closed', () => {

app.on('before-quit', () => {
if (rendererState.isLoggedIn) {
config.set('windowState', mainWindow.getBounds());
config.set('windowState', mainWindow.getNormalBounds());
}
});

Expand Down
2 changes: 1 addition & 1 deletion app/renderer/containers/App.js
Expand Up @@ -258,7 +258,7 @@ class AppContainer extends SuperContainer {

async logOut(options = {}) {
await this.stopMarketmaker();
config.set('windowState', remote.getCurrentWindow().getBounds());
config.set('windowState', remote.getCurrentWindow().getNormalBounds());
this.setActiveView('');
this.setState({portfolio: null});
await Promise.resolve(); // Ensure the window is blank before changing the size
Expand Down

0 comments on commit 70ef052

Please sign in to comment.