[gtk+/touch-for-3.4] gdk: Make the 'emulating pointer' flag available in GdkEventTouch



commit 35c93767917ee557c0a9c3a2640a9e0eb3db8c22
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Feb 29 01:21:53 2012 -0500

    gdk: Make the 'emulating pointer' flag available in GdkEventTouch
    
    This will be used to decide for which touch events to fall back
    to button press/release handlers.

 gdk/gdkevents.h                |    3 +++
 gdk/x11/gdkdevicemanager-xi2.c |   10 ++++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/gdk/gdkevents.h b/gdk/gdkevents.h
index 79597ef..e0103c6 100644
--- a/gdk/gdkevents.h
+++ b/gdk/gdkevents.h
@@ -692,6 +692,8 @@ struct _GdkEventButton
  *   the modifier keys (e.g. Control, Shift and Alt) and the pointer
  *   buttons. See #GdkModifierType.
  * @sequence: the touch sequence that the event belongs to
+ * @emulating_pointer: whether the event should be used for emulating
+ *   pointer events
  * @device: the device where the event originated.
  * @x_root: the x coordinate of the pointer relative to the root of the
  *   screen.
@@ -713,6 +715,7 @@ struct _GdkEventTouch
   gdouble *axes;
   guint state;
   GdkTouchSequence *sequence;
+  gboolean emulating_pointer;
   GdkDevice *device;
   gdouble x_root, y_root;
 };
diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c
index 480f137..f1044be 100644
--- a/gdk/x11/gdkdevicemanager-xi2.c
+++ b/gdk/x11/gdkdevicemanager-xi2.c
@@ -1332,7 +1332,10 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
         event->touch.sequence = GUINT_TO_POINTER (xev->detail);
 
         if (xev->flags & XITouchEmulatingPointer)
-          _gdk_event_set_pointer_emulated (event, TRUE);
+          {
+            event->touch.emulating_pointer = TRUE;
+            _gdk_event_set_pointer_emulated (event, TRUE);
+          }
 
         if (return_val == FALSE)
           break;
@@ -1380,7 +1383,10 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
         event->touch.state |= GDK_BUTTON1_MASK;
 
         if (xev->flags & XITouchEmulatingPointer)
-          _gdk_event_set_pointer_emulated (event, TRUE);
+          {
+            event->touch.emulating_pointer = TRUE;
+            _gdk_event_set_pointer_emulated (event, TRUE);
+          }
 
         event->touch.axes = translate_axes (event->touch.device,
                                             event->touch.x,



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