Skip to content

Commit

Permalink
fix(Windows): Open Window when app is pinned to taskbar and minimized…
Browse files Browse the repository at this point in the history
… to system tray
  • Loading branch information
adlk committed Nov 3, 2017
1 parent 28e993e commit 777814a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ if (process.platform !== 'darwin') {
if (mainWindow.isMinimized()) mainWindow.restore();
mainWindow.focus();
}
return true;
});

if (isSecondInstance) {
Expand Down Expand Up @@ -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;
});
Expand Down

0 comments on commit 777814a

Please sign in to comment.