From 777814aa713e5093de52cb9c4c1cbf754b9e8289 Mon Sep 17 00:00:00 2001 From: Stefan Date: Fri, 3 Nov 2017 10:27:14 +0100 Subject: fix(Windows): Open Window when app is pinned to taskbar and minimized to system tray --- src/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index a6c7e1d85..a72d76f3a 100644 --- a/src/index.js +++ b/src/index.js @@ -31,7 +31,6 @@ if (process.platform !== 'darwin') { if (mainWindow.isMinimized()) mainWindow.restore(); mainWindow.focus(); } - return true; }); if (isSecondInstance) { @@ -111,6 +110,13 @@ const createWindow = async () => { app.isMaximized = true; }); + mainWindow.on('close', (e) => { + if (settings.get('minimizeToSystemTray')) { + e.preventDefault(); + mainWindow.minimize(); + } + }); + mainWindow.on('unmaximize', () => { app.isMaximized = false; }); -- cgit v1.2.3-70-g09d2