#53641: fix: show tray icon in Flatpak and Snap sandboxes
Description of Change
Closes #53307.
Since the M152 StatusNotifierItem rework, Chromium requests ownership of org.freedesktop.StatusNotifierItem-<pid>-<id> on the session bus and gives up on the D-Bus tray icon if that fails. Flatpak and Snap don't allow owning arbitrary well-known names (only --talk-name=org.kde.StatusNotifierWatcher is expected), so Tray silently fell back to the X11 icon, which is invisible on Wayland. Upstream bug: https://issues.chromium.org/issues/554905106.
This adds a patch that, inside those sandboxes (detected the same way components/dbus/xdg/systemd.cc does) or whenever ownership is refused, registers the item under the connection's unique name instead, which KDE/GNOME watchers accept and which is what Qt/KF6 do. In the sandbox case a private connection is used so the name vanishes and the watcher drops the item when the Tray is destroyed. Behaviour outside a sandbox is unchanged.
Checklist
- I have built and tested this change
- I have filled out the PR description
- I have reviewed and verified the changes
-
npm testpasses
Release Notes
Notes: Fixed Tray icons not appearing when running inside Flatpak or Snap sandboxes on Linux.
Backports
Semver Impact
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron