[gtk+/xi2: 364/1239] Add GdkDevice info to GdkEventCrossing. This is an ABI break.



commit 528cc1cb64f7d3141a2402d85dab95f2ed185ed2
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Jun 20 16:58:57 2009 +0200

    Add GdkDevice info to GdkEventCrossing. This is an ABI break.
    
    This change expands GdkEvent struct size. event->crossing.device is now
    initialized in both GdkDeviceManagerCore and GdkDeviceManagerXI2.

 gdk/gdkevents.h                 |    1 +
 gdk/x11/gdkdevicemanager-core.c |    2 ++
 gdk/x11/gdkdevicemanager-xi2.c  |    2 ++
 3 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/gdk/gdkevents.h b/gdk/gdkevents.h
index e64acb7..db277b8 100644
--- a/gdk/gdkevents.h
+++ b/gdk/gdkevents.h
@@ -368,6 +368,7 @@ struct _GdkEventCrossing
   GdkNotifyType detail;
   gboolean focus;
   guint state;
+  GdkDevice *device;
 };
 
 struct _GdkEventFocus
diff --git a/gdk/x11/gdkdevicemanager-core.c b/gdk/x11/gdkdevicemanager-core.c
index 8c19493..1052dae 100644
--- a/gdk/x11/gdkdevicemanager-core.c
+++ b/gdk/x11/gdkdevicemanager-core.c
@@ -685,6 +685,7 @@ gdk_device_manager_translate_event (GdkEventTranslator *translator,
 
       event->crossing.type = GDK_ENTER_NOTIFY;
       event->crossing.window = window;
+      event->crossing.device = device_manager->core_pointer;
 
       /* If the subwindow field of the XEvent is non-NULL, then
        *  lookup the corresponding GdkWindow.
@@ -744,6 +745,7 @@ gdk_device_manager_translate_event (GdkEventTranslator *translator,
 
       event->crossing.type = GDK_LEAVE_NOTIFY;
       event->crossing.window = window;
+      event->crossing.device = device_manager->core_pointer;
 
       /* If the subwindow field of the XEvent is non-NULL, then
        *  lookup the corresponding GdkWindow.
diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c
index c8942d3..e2f1835 100644
--- a/gdk/x11/gdkdevicemanager-xi2.c
+++ b/gdk/x11/gdkdevicemanager-xi2.c
@@ -795,6 +795,8 @@ gdk_device_manager_xi2_translate_event (GdkEventTranslator *translator,
 
         event->crossing.window = gdk_window_lookup_for_display (display, xev->event);
         event->crossing.subwindow = gdk_window_lookup_for_display (display, xev->child);
+        event->crossing.device = g_hash_table_lookup (device_manager->id_table,
+                                                      GINT_TO_POINTER (xev->deviceid));
 
         event->crossing.mode = translate_crossing_mode (xev->mode);
         event->crossing.detail = translate_notify_type (xev->detail);



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