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.
This commit is contained in:
Johannes Millan 2026-01-19 15:17:18 +01:00
parent e3b78c9c0c
commit fa8bad6292

View file

@ -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