From c5611dd76641fca83e39568dc0118f30628f83b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Papp?= Date: Mon, 1 Jun 2026 16:41:44 +0200 Subject: [PATCH] open main window on tray double-click on Windows Wire the Windows systray's double-click to ShowWindow(), matching the Windows-native convention for tray apps. The Wails v3 systray dispatches WM_LBUTTONDBLCLK to the doubleClickHandler, so OnDoubleClick fires; left- and right-click continue to open the menu. macOS/Linux are unchanged. --- client/ui/tray_click_windows.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client/ui/tray_click_windows.go b/client/ui/tray_click_windows.go index 8dece769a..86e17e9cf 100644 --- a/client/ui/tray_click_windows.go +++ b/client/ui/tray_click_windows.go @@ -2,7 +2,7 @@ package main -// bindTrayClick wires the tray icon's left-click to open the menu on Windows. +// bindTrayClick wires the tray icon's click handlers on Windows. // // Unlike macOS (NSStatusItem auto-shows the menu on left-click) and Linux // (the StatusNotifierItem host paints the menu itself), Wails v3's Windows @@ -13,10 +13,16 @@ package main // left- and right-click behave identically, matching the platform-native // click→menu behaviour we get for free on macOS/Linux. // +// On top of that, a double-click opens the main window — the Windows-native +// convention for tray apps (the Wails systray dispatches WM_LBUTTONDBLCLK to +// the doubleClickHandler; see systemtray_windows.go). ShowWindow() routes the +// SSO/install-progress edge cases correctly and calls SetForegroundWindow. +// // The macOS freeze that motivated reverting an earlier OnClick→OpenMenu wiring // (commit c77e5cef8: NSStatusItem's blocking [button mouseDown:] starves the // serial main GCD queue) does not apply here — the Windows openMenu() path is // the same menu.ShowAt() that right-click already uses without issue. func bindTrayClick(t *Tray) { t.tray.OnClick(func() { t.tray.OpenMenu() }) + t.tray.OnDoubleClick(func() { t.ShowWindow() }) }