Skip to content

Commit

Permalink
Don't include maximize in BrowserWindow options
Browse files Browse the repository at this point in the history
  • Loading branch information
scottnonnenberg-signal committed Nov 15, 2019
1 parent 6b60ca6 commit df3f583
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)
Expand All @@ -284,6 +273,9 @@ function createWindow() {
if (windowOptions.maximized) {
mainWindow.maximize();
}
if (windowOptions.fullscreen) {
mainWindow.setFullScreen(true);
}

function captureAndSaveWindowStats() {
if (!mainWindow) {
Expand All @@ -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)
Expand Down

0 comments on commit df3f583

Please sign in to comment.