From a30761c2f4a63446c1a0d7f1bd16630a4ea7b73b Mon Sep 17 00:00:00 2001
From: George Kiagiadakis <george.kiagiadakis@collabora.com>
Date: Sun, 31 May 2020 12:19:47 +0300
Subject: [PATCH] registry: forcibly add 'object.id' on all global properties

so that we can filter proxies by id on object managers
---
 lib/wp/object-manager.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/wp/object-manager.c b/lib/wp/object-manager.c
index d40baa4a..fe599d4f 100644
--- a/lib/wp/object-manager.c
+++ b/lib/wp/object-manager.c
@@ -1071,6 +1071,9 @@ wp_registry_prepare_new_global (WpRegistry * self, guint32 id,
     global->proxy = proxy;
     g_ptr_array_add (self->tmp_globals, wp_global_ref (global));
 
+    /* ensure we have 'object.id' so that we can filter by id on object managers */
+    wp_properties_setf (global->properties, PW_KEY_OBJECT_ID, "%u", global->id);
+
     /* schedule exposing when adding the first global */
     if (self->tmp_globals->len == 1) {
       wp_core_sync (core, NULL, (GAsyncReadyCallback) expose_tmp_globals, self);
-- 
GitLab