[mutter] color-device: Add new 'changed' signal for when the device changes
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] color-device: Add new 'changed' signal for when the device changes
- Date: Thu, 1 Sep 2022 17:08:35 +0000 (UTC)
commit 7b71ec8ff0e5c0056e03747adf2d818a59ea59b5
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Sat Dec 4 00:23:23 2021 +0100
color-device: Add new 'changed' signal for when the device changes
What triggers emission right now is the assigned profile changing.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2165>
src/backends/meta-color-device.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
---
diff --git a/src/backends/meta-color-device.c b/src/backends/meta-color-device.c
index 8ec1571c4e..a935723ff5 100644
--- a/src/backends/meta-color-device.c
+++ b/src/backends/meta-color-device.c
@@ -36,6 +36,7 @@
enum
{
READY,
+ CHANGED,
N_SIGNALS
};
@@ -148,7 +149,12 @@ ensure_default_profile_cb (GObject *source_object,
}
color_device = META_COLOR_DEVICE (user_data);
+ if (color_device->assigned_profile == color_profile)
+ return;
+
g_set_object (&color_device->assigned_profile, color_profile);
+
+ g_signal_emit (color_device, signals[CHANGED], 0);
}
static void
@@ -310,6 +316,12 @@ meta_color_device_class_init (MetaColorDeviceClass *klass)
NULL, NULL, NULL,
G_TYPE_NONE, 1,
G_TYPE_BOOLEAN);
+ signals[CHANGED] =
+ g_signal_new ("changed",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST, 0,
+ NULL, NULL, NULL,
+ G_TYPE_NONE, 0);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]