sni/watcher: accept combined "bus_name/object_path" item registrations (Electron 43.4.1+) - #5287
Open
teivng wants to merge 1 commit into
Open
sni/watcher: accept combined "bus_name/object_path" item registrations (Electron 43.4.1+)#5287teivng wants to merge 1 commit into
teivng wants to merge 1 commit into
Conversation
StatusNotifierItem registrations come in three shapes in the wild: a
bare bus name, a bare object path (resolved against the sender), and a
combined "bus_name/object_path" string. Electron >= 43.4.1 (Chromium
150.0.7871.224) switched its tray registration to the combined form,
e.g.
org.freedesktop.StatusNotifierItem-1234-1/StatusNotifierItem/1
The watcher only understood the first two shapes, so it ran
g_dbus_is_name() on the whole combined string, rejected the
registration with InvalidArgs, and the client tore down its tray icon:
Signal-Desktop 8.25+ (and anything else on Electron 43.4.1+) never
shows a tray icon. KDE's StatusNotifierWatcher accepts the combined
form.
Split the string at the first '/' when it does not start with one.
Fixes Alexays#5240
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5240.
Problem
Electron ≥ 43.4.1 (Chromium 150.0.7871.224) changed how its tray icon registers with the StatusNotifierWatcher: instead of a bare object path it now sends a combined
bus_name/object_pathstring. Captured on the bus (busctl --user monitor org.kde.StatusNotifierWatcher), Signal-Desktop 8.25.0:Watcher::handleRegisterItemonly understands two shapes — a string starting with/(object path, resolved against the sender) or a plain bus name — so it runsg_dbus_is_name()on the whole combined string and rejects it:On rejection Electron releases its bus name and destroys the tray icon permanently (it does not retry, not even when the watcher restarts), so the app shows no tray icon for the rest of its lifetime. Side-by-side comparison of the same app across the Electron bump:
/org/chromium/StatusNotifierItem/1org.freedesktop.StatusNotifierItem-36777-1/StatusNotifierItem/1Slack (Electron 43.4.0) still registers with a bare bus name and works, so this will progressively hit every Electron app as they update past 43.4.1. KDE's StatusNotifierWatcher accepts the combined form.
Fix
When the service string contains a
/but does not start with one, split at the first/into bus name and object path. The two existing forms are handled exactly as before. As a bonus,g_bus_watch_name()now watches the actual bus name for these items, so they are pruned correctly when the owner exits.Testing
Running this patch on waybar 0.15.0 under Hyprland: Signal 8.25.0's icon registers, appears in the tray, and survives repeated window close/reopen (close-to-tray) cycles; Slack, Telegram, Bitwarden, udiskie and nm-applet items are unaffected.
🤖 Generated with Claude Code