mirror of
https://github.com/netbirdio/netbird.git
synced 2026-05-20 15:49:55 +00:00
1.1 KiB
1.1 KiB
Linux tray support (StatusNotifierWatcher + XEmbed)
Minimal WMs (Fluxbox, OpenBox, i3, dwm, vanilla GNOME without the AppIndicator extension) don't ship a StatusNotifierWatcher, so tray icons using libayatana-appindicator / freedesktop StatusNotifier silently fail. main.go calls startStatusNotifierWatcher() before NewTray so the Wails systray's RegisterStatusNotifierItem call hits the in-process watcher we control.
tray_watcher_linux.go— ownsorg.kde.StatusNotifierWatcheron the session bus if no other process has it. Safe to call unconditionally.xembed_host_linux.go+xembed_tray_linux.{c,h}— when an XEmbed tray (_NET_SYSTEM_TRAY_S0) is available, also start an in-process XEmbed host that bridges the SNI icon into the XEmbed tray. ReadsIconPixmapover D-Bus, draws via cairo+X11, polls for clicks, fetchescom.canonical.dbusmenu.GetLayoutfor the popup menu, firescom.canonical.dbusmenu.Eventon click.
Build is gated on linux && !386; the 386 build (no cgo) and non-Linux builds use the tray_watcher_other.go no-op.