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

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