diff --git a/lib/src/dbus_remote_object_manager.dart b/lib/src/dbus_remote_object_manager.dart index fb3d658..fe52ca4 100644 --- a/lib/src/dbus_remote_object_manager.dart +++ b/lib/src/dbus_remote_object_manager.dart @@ -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' &&