[gtk+] gdk: add accessor for GdkEventOwnerChange::reason



commit 4808829352d9c450cded059ed49bdc5936ed0df2
Author: Marc-Antoine Perennou <Marc-Antoine Perennou com>
Date:   Thu Oct 19 14:22:23 2017 +0200

    gdk: add accessor for GdkEventOwnerChange::reason
    
    https://bugzilla.gnome.org/show_bug.cgi?id=789198
    
    Signed-off-by: Marc-Antoine Perennou <Marc-Antoine Perennou com>

 gdk/gdkevents.c |   23 +++++++++++++++++++++++
 gdk/gdkevents.h |    3 +++
 2 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c
index 65bd821..63d17ea 100644
--- a/gdk/gdkevents.c
+++ b/gdk/gdkevents.c
@@ -3005,6 +3005,29 @@ gdk_event_get_selection (const GdkEvent   *event,
 }
 
 /**
+ * gdk_event_get_owner_change_reason:
+ * @event: a #GdkEvent
+ * @reason: (out):
+ *
+ * Returns: %TRUE on success, otherwise %FALSE
+ **/
+gboolean
+gdk_event_get_owner_change_reason (const GdkEvent *event,
+                                   GdkOwnerChange *reason)
+{
+  if (!event)
+    return FALSE;
+
+  if (event->type == GDK_OWNER_CHANGE)
+    {
+      *reason = event->owner_change.reason;
+      return TRUE;
+    }
+
+  return FALSE;
+}
+
+/**
  * gdk_event_get_selection_property:
  * @event: a #GdkEvent
  * @property: (out) (optional):
diff --git a/gdk/gdkevents.h b/gdk/gdkevents.h
index 61cf64a..39bb46f 100644
--- a/gdk/gdkevents.h
+++ b/gdk/gdkevents.h
@@ -791,6 +791,9 @@ gboolean       gdk_event_get_property (const GdkEvent   *event,
 GDK_AVAILABLE_IN_3_92
 gboolean       gdk_event_get_selection (const GdkEvent   *event,
                                         GdkAtom          *selection);
+GDK_AVAILABLE_IN_3_94
+gboolean       gdk_event_get_owner_change_reason (const GdkEvent *event,
+                                                  GdkOwnerChange *reason);
 GDK_AVAILABLE_IN_3_92
 gboolean       gdk_event_get_selection_property (const GdkEvent  *event,
                                                  GdkAtom         *property,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]