From d8de7fe06f05aea35b4a92a5c1859a4f907ccae1 Mon Sep 17 00:00:00 2001 From: PikachuEXE Date: Tue, 20 Sep 2022 20:49:45 +0800 Subject: [PATCH] * Implement last window's fullscreen state (#2495) --- src/main/index.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/index.js b/src/main/index.js index 59d698bd..5998ec39 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -251,7 +251,8 @@ function runApp() { const boundsDoc = await baseHandlers.settings._findBounds() if (typeof boundsDoc?.value === 'object') { - const { maximized, ...bounds } = boundsDoc.value + console.log({ boundsDoc }) + const { maximized, fullScreen, ...bounds } = boundsDoc.value const allDisplaysSummaryWidth = screen .getAllDisplays() .reduce((accumulator, { size: { width } }) => accumulator + width, 0) @@ -268,6 +269,10 @@ function runApp() { if (maximized) { newWindow.maximize() } + + if (fullScreen) { + newWindow.setFullScreen(true) + } } // If called multiple times @@ -322,7 +327,8 @@ function runApp() { const value = { ...newWindow.getNormalBounds(), - maximized: newWindow.isMaximized() + maximized: newWindow.isMaximized(), + fullScreen: newWindow.isFullScreen() } await baseHandlers.settings._updateBounds(value)