From 5ad72399cfab119b86401d7d5b8b00d28c183a11 Mon Sep 17 00:00:00 2001 From: Vishwas Shashidhar Date: Wed, 13 Jun 2018 18:09:32 +0530 Subject: [PATCH] ELECTRON-563: fix main window close issue on macOS (#398) --- js/main.js | 4 +--- js/windowMgr.js | 7 ++++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/js/main.js b/js/main.js index d482bcf3..8a3aa5db 100644 --- a/js/main.js +++ b/js/main.js @@ -169,9 +169,7 @@ app.on('ready', () => { * In which case we quit the app */ app.on('window-all-closed', function() { - if (!isMac) { - app.quit(); - } + app.quit(); }); /** diff --git a/js/windowMgr.js b/js/windowMgr.js index aadb87a4..75285070 100644 --- a/js/windowMgr.js +++ b/js/windowMgr.js @@ -288,10 +288,11 @@ function doCreateMainWindow(initialUrl, initialBounds, isCustomTitleBar) { if (getMinimizeOnClose()) { e.preventDefault(); mainWindow.minimize(); + } else if (isMac) { + e.preventDefault(); + mainWindow.hide(); } else { - if (!isMac) { - app.quit(); - } + app.quit(); } });