From cf4c8127e6cb83857e7a0b2428fc473baf333775 Mon Sep 17 00:00:00 2001 From: Jeroni Brunet Date: Wed, 6 Mar 2024 09:13:47 +0100 Subject: [PATCH] show application if not focused When clicking on the tray icon, if window is not focused show it instead of closing it. If window is closed or not focused will be shown. --- src/app/app.tray.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/app.tray.js b/src/app/app.tray.js index 3b3d29deb..514082522 100644 --- a/src/app/app.tray.js +++ b/src/app/app.tray.js @@ -51,7 +51,7 @@ function setupTray(browserWindow) { role: 'quit', }, ])) - tray.on('click', () => browserWindow.show()) + tray.on('click', () => browserWindow.isFocused() ? browserWindow.close() : browserWindow.show()) browserWindow.on('close', event => { if (!isAppQuitting) {