Files
RedBear-OS/local
vasilito 4522bc39ca sessiond+statusnotifierwatcher: inhibitor lifecycle, kstop checks, bus name
Three related fixes for redbear-sessiond and redbear-statusnotifierwatcher:

1. StatusNotifierWatcher: change well-known D-Bus name from
   'org.freedesktop.StatusNotifierWatcher' to 'org.kde.StatusNotifierWatcher'.

   Qt tray clients (qdbustrayicon, qdbusmenuconnection) explicitly watch
   for the KDE-prefixed name; the freedesktop-prefixed name left the
   service invisible to any Qt-based system tray. Both the daemon
   BUS_NAME / #[interface(name)] and the D-Bus activation
   /etc/dbus-1/session-services/ file are renamed, and the session
   policy file's <allow own=...> entry is updated. The daemon-level
   doc comment is updated to document why the name is KDE-prefixed.

2. sessiond: replace host-dependent can_methods_return_na test.

   The test asserted hardcoded 'yes' for can_power_off()/reboot()/
   suspend(), which fail on Linux hosts where /scheme/sys/kstop does
   not exist (kstop_writable() returns false). Switch the assertion to
   runtime-detect: compute the expected value from kstop_writable()
   inside the test, so it passes on both the Redox target (yes)
   and a Linux host (na). All 52 sessiond tests now pass on host.

3. sessiond: implement inhibitor lifecycle reaping.

   Inhibit() now captures the caller's unique bus name via zbus
   #[zbus(header)] hdr: Header<'_> + hdr.sender(). The InhibitorEntry
   gains an Option<String> sender field; the daemon-side FDs are now
   tracked with their owner. set_connection() spawns a background
   task that subscribes to org.freedesktop.DBus.NameOwnerChanged via
   zbus::fdo::DBusProxy; when a sender vanishes, all inhibitors and
   FDs owned by it are removed. list_inhibitors() defensively filters
   out entries with dead senders. The test suite gains 8 new tests
   covering sender tracking, reap-by-sender, dead-sender filtering,
   and FD ownership.

   Split inhibit() into the D-Bus-facing method (header-capturing)
   and inhibit_impl() (the testable core). Tests call inhibit_impl
   directly with an explicit sender argument.

Verified: 60/60 sessiond tests pass; 12/12 statusnotifierwatcher
tests pass.
2026-07-27 22:19:01 +09:00
..