Expand description
The tray icon on Linux, for both backends: a StatusNotifierItem, the
spec Plasma’s system tray, waybar, swaybar and GNOME’s AppIndicator
extension show, with its menu as com.canonical.dbusmenu. GTK 4 has no
tray, and KDE’s KStatusNotifierItem needs KDE Frameworks, which the
Kirigami shim doesn’t link, so both backends export the item here, over
GIO’s D-Bus: GTK runs GLib’s loop, and Qt’s loop on Linux is GLib’s too
(its GLib event dispatcher), so the calls come in on either.
The item owns org.kde.StatusNotifierItem-<pid>-1 and registers with
org.kde.StatusNotifierWatcher, again whenever the watcher comes back
(a panel restarting). It says ItemIsMenu, so hosts open the menu on a
click rather than calling Activate. Whether it shows is whether a
watcher with a host is there; plain GNOME has none.
Plasma’s tray and GNOME’s AppIndicator extension call
ProvideXdgActivationToken before they send a menu item’s click: the
compositor’s token for that click, which the backend gets just before
the item runs, so a window the item opens or presents can take the
focus on Wayland.
Structs§
- Tray
- The app’s tray icon: give it to the backend’s services and pass
Services::set_trayon.