[gtk+/wip/matthiasc/monitor] Add a GdkMonitor::invalidate signal
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/matthiasc/monitor] Add a GdkMonitor::invalidate signal
- Date: Tue, 12 Apr 2016 01:07:18 +0000 (UTC)
commit 194d73f43226d5b7251360455e42e2e6e54bda30
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Apr 11 20:57:43 2016 -0400
Add a GdkMonitor::invalidate signal
This can be used to track when a monitor object is dropped by the
backend, without having to listen to display signals.
gdk/gdkmonitor.c | 22 ++++++++++++++++++++++
gdk/gdkmonitorprivate.h | 1 +
2 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/gdk/gdkmonitor.c b/gdk/gdkmonitor.c
index deddb52..e5c5d5b 100644
--- a/gdk/gdkmonitor.c
+++ b/gdk/gdkmonitor.c
@@ -47,6 +47,7 @@
* - provide a persistent id (if the backend allows)
* - convert win32
* - convert quartz
+ * - convert mir
*/
enum {
PROP_0,
@@ -65,6 +66,13 @@ enum {
static GParamSpec *props[LAST_PROP] = { NULL, };
+enum {
+ INVALIDATE,
+ LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL] = { 0 };
+
G_DEFINE_TYPE (GdkMonitor, gdk_monitor, G_TYPE_OBJECT)
static void
@@ -238,6 +246,14 @@ gdk_monitor_class_init (GdkMonitorClass *class)
G_PARAM_READABLE);
g_object_class_install_properties (object_class, LAST_PROP, props);
+
+ signals[INVALIDATE] = g_signal_new ("invalidate",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_FIRST,
+ 0,
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
}
/**
@@ -587,3 +603,9 @@ gdk_monitor_set_subpixel_layout (GdkMonitor *monitor,
g_object_notify (G_OBJECT (monitor), "subpixel-layout");
}
+
+void
+gdk_monitor_invalidate (GdkMonitor *monitor)
+{
+ g_signal_emit (monitor, signals[INVALIDATE], 0);
+}
diff --git a/gdk/gdkmonitorprivate.h b/gdk/gdkmonitorprivate.h
index 0d63113..c76b59c 100644
--- a/gdk/gdkmonitorprivate.h
+++ b/gdk/gdkmonitorprivate.h
@@ -72,6 +72,7 @@ void gdk_monitor_set_refresh_rate (GdkMonitor *monitor,
int refresh_rate);
void gdk_monitor_set_subpixel_layout (GdkMonitor *monitor,
GdkSubpixelLayout subpixel);
+void gdk_monitor_invalidate (GdkMonitor *monitor);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]