Don't include maximize in BrowserWindow options

This commit is contained in:
Scott Nonnenberg 2019-11-14 14:01:52 -08:00
parent 6b60ca6bd7
commit df3f583dc9

23
main.js
View file

@ -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)