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

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