mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-23 13:59:09 +02:00
Wails v3 does not auto-show the tray menu on left-click on Windows — its
default left-click handler only logs and does nothing visible, so only
right-click opened the menu. macOS (NSStatusItem) and Linux
(StatusNotifierItem host) give us click→menu natively.
Add a build-tag-split bindTrayClick: the Windows variant wires
OnClick→OpenMenu (the same menu.ShowAt path right-click uses), while the
macOS/Linux variant stays a no-op — binding OnClick→OpenMenu on macOS
freezes the tray via NSStatusItem's blocking mouseDown on the main GCD
queue (the reason commit c77e5cef8 reverted the earlier wiring).
14 lines
641 B
Go
14 lines
641 B
Go
//go:build !windows && !android && !ios && !freebsd && !js
|
|
|
|
package main
|
|
|
|
// bindTrayClick is a no-op on macOS and Linux. On macOS the native
|
|
// NSStatusItem auto-shows the menu on left-click; on Linux the
|
|
// StatusNotifierItem host paints the menu independently. Binding an
|
|
// OnClick→OpenMenu handler is both unnecessary there and actively harmful on
|
|
// macOS, where 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 the sibling
|
|
// tray_click_windows.go file.
|
|
func bindTrayClick(*Tray) {}
|