Files
netbird/client/ui/tray_click_other.go
Zoltán Papp dfee5252a3 client/ui: open main window on tray left-click on Linux
KDE Plasma routes a tray left-click to the SNI Activate method (right-click
opens the context menu), but NetBird wired no Activate action, so on KDE a
left-click appeared completely dead while only right-click surfaced the menu.

Bind the Linux tray OnClick handler to ShowWindow(). OpenMenu() is not an
option on Linux: Wails v3 leaves linuxSystemTray.openMenu unimplemented (it
only logs), so left-click→OpenMenu would still do nothing on KDE. ShowWindow()
is the same call Windows already runs from its double-click handler, and it
does not reproduce the macOS OpenMenu freeze (c77e5cef8) — that came from
NSStatusItem's blocking embedded menu loop, whereas Show/Focus return
immediately.

Split the Linux click handler into its own tray_click_linux.go and narrow the
macOS no-op bindTrayClick build tag accordingly. The context menu stays on
right-click on every host. On hosts that already open the menu on left-click
natively (GNOME Shell + AppIndicator) left-click now opens the window instead;
the menu remains on right-click.
2026-06-01 22:04:49 +02:00

12 lines
554 B
Go

//go:build !windows && !linux && !android && !ios && !freebsd && !js
package main
// bindTrayClick is a no-op on macOS. The native NSStatusItem auto-shows the
// menu on left-click, so binding an OnClick→OpenMenu handler is both
// unnecessary and actively harmful: OpenMenu routes through NSStatusItem's
// blocking [button mouseDown:] on the serial main GCD queue and freezes the
// tray and webview until the menu closes (commit c77e5cef8). Windows opts in
// via tray_click_windows.go; Linux via tray_click_linux.go.
func bindTrayClick(*Tray) {}