2
2
mirror of https://github.com/Llewellynvdm/nativefier.git synced 2024-12-23 10:38:55 +00:00

Fix #462 - When minimized to tray and single-instance, re-running the app should activate and focus it (#490)

This commit is contained in:
Ronan Jouchet 2017-11-24 10:31:08 -05:00 committed by GitHub
parent 2b377a7916
commit 8963544afa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -122,7 +122,9 @@ if (appArgs.singleInstance) {
const shouldQuit = app.makeSingleInstance(() => { const shouldQuit = app.makeSingleInstance(() => {
// Someone tried to run a second instance, we should focus our window. // Someone tried to run a second instance, we should focus our window.
if (mainWindow) { if (mainWindow) {
if (mainWindow.isMinimized()) { if (!mainWindow.isVisible()) { // tray
mainWindow.show();
} if (mainWindow.isMinimized()) { // minimized
mainWindow.restore(); mainWindow.restore();
} }
mainWindow.focus(); mainWindow.focus();