From 61ed2a21c68f6d41fb57d103db6e025779eafcc7 Mon Sep 17 00:00:00 2001 From: Maxwell Clarke Date: Tue, 1 Feb 2022 01:15:31 +1300 Subject: [PATCH] "Show/Hide" tray action shows window from background instead of hiding it. (#312) --- src/tray.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tray.ts b/src/tray.ts index 5c70478..6d95d30 100644 --- a/src/tray.ts +++ b/src/tray.ts @@ -36,7 +36,7 @@ export function destroy(): void { } function toggleWin(): void { - if (global.mainWindow.isVisible() && !global.mainWindow.isMinimized()) { + if (global.mainWindow.isVisible() && !global.mainWindow.isMinimized() && global.mainWindow.isFocused()) { global.mainWindow.hide(); } else { if (global.mainWindow.isMinimized()) global.mainWindow.restore();