@@ -24,7 +24,6 @@ import { collectMemorySnapshot } from "./utils/crash-diagnostics";
2424import { isDevBuild } from "./utils/env" ;
2525import { logger , readChromiumLogTail } from "./utils/logger" ;
2626import {
27- getRestoreFullScreenOnNextLaunch ,
2827 saveFullScreenState ,
2928 saveZoomLevel ,
3029 setRestoreFullScreenOnNextLaunch ,
@@ -79,10 +78,8 @@ export function saveWindowState(window: BrowserWindow): void {
7978 const isMaximized = window . isMaximized ( ) ;
8079 windowStateStore . set ( "isMaximized" , isMaximized ) ;
8180
82- // Only save bounds when the window is in its normal state. Persisting the
83- // maximized or fullscreen bounds would clobber the user's windowed
84- // size/position, so a later "revert to windowed" launch has nothing to
85- // restore to.
81+ // Only save bounds when not maximized, so restoring from maximized
82+ // gives the user their previous windowed size/position
8683 if ( ! isMaximized && ! window . isFullScreen ( ) ) {
8784 const bounds = window . getBounds ( ) ;
8885 windowStateStore . set ( "x" , bounds . x ) ;
@@ -170,9 +167,8 @@ export function createWindow(): void {
170167 const savedState = getSavedWindowState ( ) ;
171168
172169 // Read the one-shot fullscreen-restore flag and clear it immediately, so it
173- // only ever affects the single launch that follows an update restart. A
174- // normal quit never sets it, so this is false and the app launches windowed.
175- const restoreFullScreen = getRestoreFullScreenOnNextLaunch ( ) ;
170+ // only ever affects the single launch that follows an update restart.
171+ const restoreFullScreen = savedState . restoreFullScreenOnNextLaunch ;
176172 if ( restoreFullScreen ) {
177173 setRestoreFullScreenOnNextLaunch ( false ) ;
178174 }
0 commit comments