From 3f8ce93636f7a66876efb059c5c8bfe3fd8bb56b Mon Sep 17 00:00:00 2001 From: kolaente Date: Sat, 27 Jun 2026 15:44:28 +0200 Subject: [PATCH] fix(desktop): show hidden window when relaunched from tray MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the app is hidden in the tray, closing then relaunching it triggered the single-instance second-instance handler, which only called focus() — a hidden window stays hidden on focus(), so the app appeared not to start (notably on KDE Plasma Wayland where the tray icon may also be unreachable). Call show() to surface it, and recreate the window if it no longer exists. --- desktop/main.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/desktop/main.js b/desktop/main.js index 55a0ea062..ee1b13172 100644 --- a/desktop/main.js +++ b/desktop/main.js @@ -100,10 +100,15 @@ app.on('second-instance', (_event, argv) => { return } - // Focus the main window + // Reveal the main window. It may be hidden in the tray (not just minimized), + // so show() is required — focus() alone won't surface a hidden window, which + // made the app look dead when relaunched while running in the tray. if (mainWindow) { if (mainWindow.isMinimized()) mainWindow.restore() + mainWindow.show() mainWindow.focus() + } else if (serverPort) { + createMainWindow() } // Find the deep link URL in argv