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() }) }