diff --git a/src/main/index.ts b/src/main/index.ts index 727c10495c1..618f2f505b1 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -95,10 +95,19 @@ function focusExistingWindow(): void { // after another launch tries (and fails) to acquire the lock. Bring the // existing window forward so the user sees the same focus behaviour as // re-clicking the dock/taskbar icon, rather than a silent no-op. + // + // Why show() as well as restore() + focus(): isMinimized() only covers the + // dock-minimised case. A hidden window (close-to-tray on macOS via Cmd+W, + // or a window on a different macOS Space) is NOT minimised, so focus() + // alone is a silent no-op. show() handles those plus Windows taskbar + // focus-steal, which focus() alone does not reliably trigger. if (mainWindow) { if (mainWindow.isMinimized()) { mainWindow.restore() } + if (!mainWindow.isVisible()) { + mainWindow.show() + } mainWindow.focus() } // Pre-window case: the primary is still booting and will call