From fa8bad62923a07ae2b4af9e9e046cd3ef47c0c75 Mon Sep 17 00:00:00 2001 From: Johannes Millan Date: Mon, 19 Jan 2026 15:17:18 +0100 Subject: [PATCH] fix(electron): restore hidden window on taskbar click Fixes #6042 where app wouldn't launch from taskbar when minimize to tray was enabled. The second-instance handler now uses showOrFocus() which properly handles both hidden and minimized windows, matching the behavior of the tray icon click handler. --- electron/protocol-handler.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/electron/protocol-handler.ts b/electron/protocol-handler.ts index 8a56c0fc2..f16d5c988 100644 --- a/electron/protocol-handler.ts +++ b/electron/protocol-handler.ts @@ -2,6 +2,7 @@ import { App, BrowserWindow } from 'electron'; import { log } from 'electron-log/main'; import * as path from 'path'; import { IPC } from './shared-with-frontend/ipc-events.const'; +import { showOrFocus } from './various-shared'; export const PROTOCOL_NAME = 'superproductivity'; export const PROTOCOL_PREFIX = `${PROTOCOL_NAME}://`; @@ -89,8 +90,7 @@ export const initializeProtocolHandling = ( // Someone tried to run a second instance, we should focus our window instead. if (mainWin) { - if (mainWin.isMinimized()) mainWin.restore(); - mainWin.focus(); + showOrFocus(mainWin); } // Handle protocol url from second instance