From 8773b5a23e32ef4621e42696941b5c5098bf0955 Mon Sep 17 00:00:00 2001 From: stefan Date: Sun, 23 Aug 2026 06:32:28 +0700 Subject: [PATCH 1/3] feat(linux): implement SetTooltip for the system tray MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit setTooltip was a stub on Linux, so the only hover text a tray icon could have was its name — SetLabel doubles as that, and the ToolTip property was published with an empty description. StatusNotifierItem's ToolTip carries a description under the title, which is where a desktop shows the extra line, so SetTooltip fills it in. The property is declared with prop.EmitTrue, so setting it is what tells the host to re-read it; setLabel refreshes it too, since the title half follows the name. --- v3/pkg/application/systemtray_linux.go | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/v3/pkg/application/systemtray_linux.go b/v3/pkg/application/systemtray_linux.go index fc8307ee88f..5b7c7d1e15d 100644 --- a/v3/pkg/application/systemtray_linux.go +++ b/v3/pkg/application/systemtray_linux.go @@ -449,8 +449,24 @@ func (s *linuxSystemTray) run() { s.setMenu(s.menu) } -func (s *linuxSystemTray) setTooltip(_ string) { - // TBD +func (s *linuxSystemTray) setTooltip(text string) { + s.tooltip = text + s.updateToolTip() +} + +// updateToolTip republishes the ToolTip property. Its title is the item's name +// and its description is what SetTooltip was given, which is the line a desktop +// shows under the name on hover. The property is declared with prop.EmitTrue, +// so setting it is what tells the host to re-read it. +func (s *linuxSystemTray) updateToolTip() { + if s.props == nil { + return + } + + if err := s.props.Set("org.kde.StatusNotifierItem", "ToolTip", + dbus.MakeVariant(tooltip{V2: s.label, V3: s.tooltip})); err != nil { + globalApplication.error("systray error: failed to set ToolTip prop: %w", err) + } } func (s *linuxSystemTray) setIcon(icon []byte) { @@ -533,6 +549,8 @@ func (s *linuxSystemTray) setLabel(label string) { return } + // The tooltip repeats the name as its title, so it follows the label. + s.updateToolTip() } func (s *linuxSystemTray) destroy() { From baf716f7b5d35bc1019801f4bb77ea5e2dfc78be Mon Sep 17 00:00:00 2001 From: stefan Date: Mon, 24 Aug 2026 00:15:43 +0700 Subject: [PATCH 2/3] docs: changelog entry --- v3/UNRELEASED_CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/v3/UNRELEASED_CHANGELOG.md b/v3/UNRELEASED_CHANGELOG.md index 33638e7fc86..02ef3cc17a9 100644 --- a/v3/UNRELEASED_CHANGELOG.md +++ b/v3/UNRELEASED_CHANGELOG.md @@ -23,6 +23,7 @@ After processing, the content will be moved to the main changelog and this file ## Fixed +- Fix `SystemTray.SetTooltip()` doing nothing on Linux: the StatusNotifierItem tooltip description is now set ## Deprecated From dd68aeb62b68e13d60bb3512598014504e229d7f Mon Sep 17 00:00:00 2001 From: stefan Date: Mon, 24 Aug 2026 00:52:18 +0700 Subject: [PATCH 3/3] fix(linux): refresh the tooltip before setLabel can return early setLabel updates Title and then returns if there is no connection or the NewTitle signal fails, so the published ToolTip kept the previous label while Title held the new one. The tooltip follows the title, so it is refreshed as soon as the title is known to have changed. --- v3/UNRELEASED_CHANGELOG.md | 2 +- v3/pkg/application/systemtray_linux.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/v3/UNRELEASED_CHANGELOG.md b/v3/UNRELEASED_CHANGELOG.md index 02ef3cc17a9..d9af53063f5 100644 --- a/v3/UNRELEASED_CHANGELOG.md +++ b/v3/UNRELEASED_CHANGELOG.md @@ -23,7 +23,7 @@ After processing, the content will be moved to the main changelog and this file ## Fixed -- Fix `SystemTray.SetTooltip()` doing nothing on Linux: the StatusNotifierItem tooltip description is now set +- Fix `SystemTray.SetTooltip()` doing nothing on Linux: the StatusNotifierItem tooltip description is now set (#6017) ## Deprecated diff --git a/v3/pkg/application/systemtray_linux.go b/v3/pkg/application/systemtray_linux.go index 5b7c7d1e15d..7ef806636d9 100644 --- a/v3/pkg/application/systemtray_linux.go +++ b/v3/pkg/application/systemtray_linux.go @@ -537,6 +537,9 @@ func (s *linuxSystemTray) setLabel(label string) { return } + // The tooltip repeats the name as its title, so it follows the label. + s.updateToolTip() + if s.conn == nil { return } @@ -548,9 +551,6 @@ func (s *linuxSystemTray) setLabel(label string) { globalApplication.error("systray error: failed to emit new title signal: %w", err) return } - - // The tooltip repeats the name as its title, so it follows the label. - s.updateToolTip() } func (s *linuxSystemTray) destroy() {