From 961568d4176185ef7146f6a8209940f52f53cecd 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. Signed-off-by: Jeroni Brunet --- 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 3b3d29de..51408252 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) {