From df3f583dc95d9a159bb028131f5e779f2ce1a272 Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Thu, 14 Nov 2019 14:01:52 -0800 Subject: [PATCH] Don't include maximize in BrowserWindow options --- main.js | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/main.js b/main.js index 736694f5ef60..24b07418bd0a 100644 --- a/main.js +++ b/main.js @@ -234,14 +234,7 @@ function createWindow() { }, icon: path.join(__dirname, 'images', 'icon_256.png'), }, - _.pick(windowConfig, [ - 'maximized', - 'autoHideMenuBar', - 'width', - 'height', - 'x', - 'y', - ]) + _.pick(windowConfig, ['autoHideMenuBar', 'width', 'height', 'x', 'y']) ); if (!_.isNumber(windowOptions.width) || windowOptions.width < MIN_WIDTH) { @@ -270,10 +263,6 @@ function createWindow() { delete windowOptions.y; } - if (windowOptions.fullscreen === false) { - delete windowOptions.fullscreen; - } - logger.info( 'Initializing BrowserWindow config: %s', JSON.stringify(windowOptions) @@ -284,6 +273,9 @@ function createWindow() { if (windowOptions.maximized) { mainWindow.maximize(); } + if (windowOptions.fullscreen) { + mainWindow.setFullScreen(true); + } function captureAndSaveWindowStats() { if (!mainWindow) { @@ -297,18 +289,13 @@ function createWindow() { windowConfig = { maximized: mainWindow.isMaximized(), autoHideMenuBar: mainWindow.isMenuBarAutoHide(), + fullscreen: mainWindow.isFullScreen(), width: size[0], height: size[1], x: position[0], y: position[1], }; - if (mainWindow.isFullScreen()) { - // Only include this property if true, because when explicitly set to - // false the fullscreen button will be disabled on osx - windowConfig.fullscreen = true; - } - logger.info( 'Updating BrowserWindow config: %s', JSON.stringify(windowConfig)