Skip to content

Commit

Permalink
Handle incomplete StatusNotifierWatchers
Browse files Browse the repository at this point in the history
kded6 provides an `org.kde.StatusNotifierWatcher` service without its usual `/StatusNotifierWatcher` object if Plasma Workspace's StatusNotifierWatcher module is registered but not loaded (https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/3301). We thus cannot just assume the whole service to be unavailable if the registration fails as we restart the tray application when the name appears.

This is a problem if the Plasma Workspace is around especially on i3 where no other application registers `org.kde.StatusNotifierWatcher`.

Closes #2311
  • Loading branch information
cschramm authored and infirit committed May 17, 2024
1 parent bfe29e9 commit 1cd2279
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions blueman/main/indicators/StatusNotifierItem.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ def on_watcher_appeared(*args: Any) -> None:
"RegisterStatusNotifierItem", GLib.Variant("(s)", ("/org/blueman/sni",)),
None, Gio.DBusCallFlags.NONE, -1)
watcher_expected = True
except GLib.Error:
watcher_expected = False
except GLib.Error as e:
watcher_expected = not e.message.startswith("org.freedesktop.DBusError.ServiceUnknown")
raise IndicatorNotAvailable

def set_icon(self, icon_name: str) -> None:
Expand Down

0 comments on commit 1cd2279

Please sign in to comment.