Blame SOURCES/0001-gdbus-Emit-InterfacesAdded-of-parents-objects-first.patch

514bad
From 4c3eedcb96bd4795dd5c25c688005fc12f364aeb Mon Sep 17 00:00:00 2001
514bad
From: Gopal Tiwari <gtiwari@redhat.com>
514bad
Date: Wed, 20 Apr 2022 12:19:05 +0530
514bad
Subject: [PATCH BlueZ] gdbus: Emit InterfacesAdded of parents objects first
514bad
514bad
This makes InterfacesAdded respect the object hierarchy in case its
514bad
parent has pending interfaces to be added.
514bad
514bad
Fixes: #272
514bad
Fixes: #284
514bad
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1534857
514bad
Fixes: https://bugs.archlinux.org/task/57464
514bad
---
514bad
 gdbus/object.c | 6 ++++++
514bad
 1 file changed, 6 insertions(+)
514bad
514bad
diff --git a/gdbus/object.c b/gdbus/object.c
514bad
index 50a8b4ff1..f7c8c2be5 100644
514bad
--- a/gdbus/object.c
514bad
+++ b/gdbus/object.c
514bad
@@ -551,6 +551,12 @@ static void emit_interfaces_added(struct generic_data *data)
514bad
 	if (root == NULL || data == root)
514bad
 		return;
514bad
 
514bad
+	/* Emit InterfacesAdded on the parent first so it appears first on the
514bad
+	 * bus as child objects may point to it.
514bad
+	 */
514bad
+	if (data->parent && data->parent->added)
514bad
+		emit_interfaces_added(data->parent);
514bad
+
514bad
 	signal = dbus_message_new_signal(root->path,
514bad
 					DBUS_INTERFACE_OBJECT_MANAGER,
514bad
 					"InterfacesAdded");
514bad
-- 
514bad
2.26.2
514bad