From e8d169db8dc4437d0351d14527749327a3f83e3c Mon Sep 17 00:00:00 2001 From: Will Norris Date: Thu, 4 Jun 2026 12:54:29 -0700 Subject: [PATCH] client/systray: fix setting StatusNotifierItem ID This was supposed to have been fixed in #18739, but either there was a regression, or it never actually fixed it. In order for the application title to be used as the ID by the fyne.io/systray package, systray.SetTitle() must be called before systray.Run(). Updates #18736 Signed-off-by: Will Norris --- client/systray/systray.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/client/systray/systray.go b/client/systray/systray.go index 33155008e..eb550fde4 100644 --- a/client/systray/systray.go +++ b/client/systray/systray.go @@ -69,6 +69,11 @@ func (menu *Menu) Run(client *local.Client) { go menu.lc.SetGauge(menu.bgCtx, "systray_running", 1) defer menu.lc.SetGauge(menu.bgCtx, "systray_running", 0) + // set initial title, which is used by the systray package as the ID of the StatusNotifierItem. + // This value will get overwritten later as the client status changes. + // This must be called before systray.Run. + systray.SetTitle("tailscale") + systray.Run(menu.onReady, menu.onExit) } @@ -172,10 +177,6 @@ See https://tailscale.com/kb/1597/linux-systray for more information.`) } setAppIcon(disconnected) - // set initial title, which is used by the systray package as the ID of the StatusNotifierItem. - // This value will get overwritten later as the client status changes. - systray.SetTitle("tailscale") - menu.rebuild() menu.mu.Lock()