From 9de6efb767c32bca00c6c89d32a19766ac6da908 Mon Sep 17 00:00:00 2001 From: Tasso Evangelista Date: Mon, 22 Oct 2018 14:49:13 -0300 Subject: [PATCH 1/2] Always minimize or hide the main window on close --- src/background/mainWindow.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/background/mainWindow.js b/src/background/mainWindow.js index 628c6b69cc..631172ecee 100644 --- a/src/background/mainWindow.js +++ b/src/background/mainWindow.js @@ -11,7 +11,7 @@ import windowStateKeeper from './windowState'; import env from '../env'; let mainWindow = null; -let hideOnClose = true; +let hideOnClose = false; const mainWindowOptions = { width: 1000, @@ -49,11 +49,11 @@ const attachWindowStateHandling = (mainWindow) => { event.preventDefault(); if (mainWindow.isFullScreen()) { mainWindow.once('leave-full-screen', () => { - (process.platform === 'darwin' || hideOnClose) ? mainWindow.hide() : mainWindow.destroy(); + (process.platform === 'darwin' || hideOnClose) ? mainWindow.hide() : mainWindow.minimize(); }); mainWindow.setFullScreen(false); } else { - (process.platform === 'darwin' || hideOnClose) ? mainWindow.hide() : mainWindow.destroy(); + (process.platform === 'darwin' || hideOnClose) ? mainWindow.hide() : mainWindow.minimize(); } mainWindowState.saveState(mainWindow); }); From ddbaaea543a8d49b2f3c4a9724060b9dc646e110 Mon Sep 17 00:00:00 2001 From: Tasso Evangelista Date: Mon, 22 Oct 2018 15:07:34 -0300 Subject: [PATCH 2/2] Don't show tray icon by default in Linux --- src/scripts/events.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/scripts/events.js b/src/scripts/events.js index 7219d4811d..9d0426a123 100644 --- a/src/scripts/events.js +++ b/src/scripts/events.js @@ -70,7 +70,8 @@ export default () => { const mainWindow = getCurrentWindow(); menus.setState({ - showTrayIcon: localStorage.getItem('hideTray') !== 'true', + showTrayIcon: localStorage.getItem('hideTray') ? + localStorage.getItem('hideTray') !== 'true' : (process.platform !== 'linux'), showUserStatusInTray: (localStorage.getItem('showUserStatusInTray') || 'true') === 'true', showFullScreen: mainWindow.isFullScreen(), showWindowOnUnreadChanged: localStorage.getItem('showWindowOnUnreadChanged') === 'true', @@ -79,7 +80,8 @@ export default () => { }); tray.setState({ - showIcon: localStorage.getItem('hideTray') !== 'true', + showIcon: localStorage.getItem('hideTray') ? + localStorage.getItem('hideTray') !== 'true' : (process.platform !== 'linux'), showUserStatus: (localStorage.getItem('showUserStatusInTray') || 'true') === 'true', }); };