[mutter] color-manager: Add ready state
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] color-manager: Add ready state
- Date: Thu, 1 Sep 2022 15:38:14 +0000 (UTC)
commit 8826b29329b7fb3a1340b42a5f94c49e49c757f5
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Tue Nov 30 08:22:33 2021 +0100
color-manager: Add ready state
Ready means it has established the connection to colord and can operate.
Will be used by tests to make sure tests don't fail due to race
conditions when connecting to colord.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2164>
src/backends/meta-color-manager-private.h | 3 +++
src/backends/meta-color-manager.c | 13 +++++++++++++
2 files changed, 16 insertions(+)
---
diff --git a/src/backends/meta-color-manager-private.h b/src/backends/meta-color-manager-private.h
index db5d425e95..aa09045334 100644
--- a/src/backends/meta-color-manager-private.h
+++ b/src/backends/meta-color-manager-private.h
@@ -29,4 +29,7 @@ struct _MetaColorManagerClass
CdClient * meta_color_manager_get_cd_client (MetaColorManager *color_manager);
+META_EXPORT_TEST
+gboolean meta_color_manager_is_ready (MetaColorManager *color_manager);
+
#endif /* META_COLOR_MANAGER_PRIVATE_H */
diff --git a/src/backends/meta-color-manager.c b/src/backends/meta-color-manager.c
index 6f7ac24bfd..3bc31644ec 100644
--- a/src/backends/meta-color-manager.c
+++ b/src/backends/meta-color-manager.c
@@ -74,6 +74,8 @@ typedef struct _MetaColorManagerPrivate
GHashTable *devices;
MetaDbusSettingsDaemonColor *gsd_color;
+
+ gboolean is_ready;
} MetaColorManagerPrivate;
G_DEFINE_TYPE_WITH_PRIVATE (MetaColorManager, meta_color_manager, G_TYPE_OBJECT)
@@ -203,6 +205,8 @@ cd_client_connect_cb (GObject *source_object,
g_signal_connect (monitor_manager, "monitors-changed-internal",
G_CALLBACK (on_monitors_changed),
color_manager);
+
+ priv->is_ready = TRUE;
}
static void
@@ -367,3 +371,12 @@ meta_color_manager_get_color_device (MetaColorManager *color_manager,
monitor_id = generate_monitor_id (monitor);
return g_hash_table_lookup (priv->devices, monitor_id);
}
+
+gboolean
+meta_color_manager_is_ready (MetaColorManager *color_manager)
+{
+ MetaColorManagerPrivate *priv =
+ meta_color_manager_get_instance_private (color_manager);
+
+ return priv->is_ready;
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]