Skip to content

Commit

Permalink
Work around a dbus-broker bug with path_namespace='/' match rules (#381)
Browse files Browse the repository at this point in the history
  • Loading branch information
PapyElGringo authored Aug 30, 2024
1 parent 5aef6f5 commit d619bd1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/src/dbus_remote_object_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,13 @@ class DBusRemoteObjectManager extends DBusRemoteObject {
DBusRemoteObjectManager(DBusClient client,
{required String name, required DBusObjectPath path})
: super(client, name: name, path: path) {
// Only add path_namespace if it's non-'/'. This removes a no-op key from
// the match rule, and also works around a D-Bus bug where
// path_namespace='/' matches nothing.
// https://github.com/bus1/dbus-broker/issues/309
var pathNamespace = path.value != '/' ? path : null;
var rawSignals =
DBusSignalStream(client, sender: name, pathNamespace: path);
DBusSignalStream(client, sender: name, pathNamespace: pathNamespace);
signals = rawSignals.map((signal) {
if (signal.interface == 'org.freedesktop.DBus.ObjectManager' &&
signal.name == 'InterfacesAdded' &&
Expand Down

0 comments on commit d619bd1

Please sign in to comment.