[gtk/wip/matthiasc/focus2: 42/50] Add crossing mode and detail to focus events



commit e0b1c45d8333b036e488e547a70f3414eac9b8aa
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Mar 6 16:55:27 2019 -0500

    Add crossing mode and detail to focus events
    
    We want focus events more similar to crossing events.

 gdk/gdkevents.c        | 10 ++++++++++
 gdk/gdkeventsprivate.h |  4 ++++
 2 files changed, 14 insertions(+)
---
diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c
index 3b0944d3cc..55b744d4f3 100644
--- a/gdk/gdkevents.c
+++ b/gdk/gdkevents.c
@@ -1980,6 +1980,11 @@ gdk_event_get_crossing_mode (const GdkEvent  *event,
       *mode = event->crossing.mode;
       return TRUE;
     }
+  else if (event->any.type == GDK_FOCUS_CHANGE)
+    {
+      *mode = event->focus_change.mode;
+      return TRUE;
+    }
 
   return FALSE;
 }
@@ -2006,6 +2011,11 @@ gdk_event_get_crossing_detail (const GdkEvent *event,
       *detail = event->crossing.detail;
       return TRUE;
     }
+  else if (event->any.type == GDK_FOCUS_CHANGE)
+    {
+      *detail = event->focus_change.detail;
+      return TRUE;
+    }
 
   return FALSE;
 }
diff --git a/gdk/gdkeventsprivate.h b/gdk/gdkeventsprivate.h
index b81faba589..1c6756e60a 100644
--- a/gdk/gdkeventsprivate.h
+++ b/gdk/gdkeventsprivate.h
@@ -312,6 +312,8 @@ struct _GdkEventCrossing
  * @send_event: %TRUE if the event was sent explicitly.
  * @in: %TRUE if the surface has gained the keyboard focus, %FALSE if
  *   it has lost the focus.
+ * @mode: the crossing mode
+ * @detail: the kind of crossing that happened
  *
  * Describes a change of keyboard focus.
  */
@@ -319,6 +321,8 @@ struct _GdkEventFocus
 {
   GdkEventAny any;
   gint16 in;
+  GdkCrossingMode mode;
+  GdkNotifyType detail;
 };
 
 /*


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