Skip to content

Commit

Permalink
gdbus: Emit InterfacesAdded of parents objects first
Browse files Browse the repository at this point in the history
This makes InterfacesAdded respect the object hierarchy in case its
parent has pending interfaces to be added.

Fixes: bluez/bluez#272
Fixes: bluez/bluez#284
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1534857
Fixes: https://bugs.archlinux.org/task/57464
  • Loading branch information
Vudentz authored and hadess committed Aug 26, 2022
1 parent 656d05e commit f36c0b9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gdbus/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,12 @@ static void emit_interfaces_added(struct generic_data *data)
if (root == NULL || data == root)
return;

/* Emit InterfacesAdded on the parent first so it appears first on the
* bus as child objects may point to it.
*/
if (data->parent && data->parent->added)
emit_interfaces_added(data->parent);

signal = dbus_message_new_signal(root->path,
DBUS_INTERFACE_OBJECT_MANAGER,
"InterfacesAdded");
Expand Down

0 comments on commit f36c0b9

Please sign in to comment.