[gtk+/multitouch: 13/13] gdk: Update touch events to latest spec



commit b93a225b2ebfd29b5812f396728316126d86c64b
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Sep 18 09:46:38 2011 +0200

    gdk: Update touch events to latest spec

 gdk/x11/gdkdevice-xi2.c        |    4 +---
 gdk/x11/gdkdevicemanager-xi2.c |   21 +++++++--------------
 2 files changed, 8 insertions(+), 17 deletions(-)
---
diff --git a/gdk/x11/gdkdevice-xi2.c b/gdk/x11/gdkdevice-xi2.c
index ad89c99..dca88d7 100644
--- a/gdk/x11/gdkdevice-xi2.c
+++ b/gdk/x11/gdkdevice-xi2.c
@@ -691,10 +691,8 @@ _gdk_x11_device_xi2_translate_event_mask (GdkEventMask  event_mask,
   if (event_mask & GDK_TOUCH_MASK)
     {
       XISetMask (mask, XI_TouchBegin);
-      XISetMask (mask, XI_TouchMotion);
-      XISetMask (mask, XI_TouchMotionUnowned);
+      XISetMask (mask, XI_TouchUpdate);
       XISetMask (mask, XI_TouchEnd);
-      XISetMask (mask, XI_TouchOwnership);
     }
 #endif /* XINPUT_2_1 */
 
diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c
index 80483fb..40488e3 100644
--- a/gdk/x11/gdkdevicemanager-xi2.c
+++ b/gdk/x11/gdkdevicemanager-xi2.c
@@ -906,8 +906,7 @@ get_event_window (GdkEventTranslator *translator,
     case XI_ButtonRelease:
     case XI_Motion:
 #ifdef XINPUT_2_1
-    case XI_TouchMotion:
-    case XI_TouchMotionUnowned:
+    case XI_TouchUpdate:
     case XI_TouchBegin:
     case XI_TouchEnd:
 #endif /* XINPUT_2_1 */
@@ -1056,7 +1055,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
 
   window = get_event_window (translator, ev);
 
-  if (window && GDK_WINDOW_DESTROYED (window))
+  if (!window || GDK_WINDOW_DESTROYED (window))
     return FALSE;
 
   if (ev->evtype == XI_Motion ||
@@ -1173,9 +1172,10 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
         else
           {
 #ifdef XINPUT_2_1
-            if (ev->evtype == XI_TouchBegin ||
-                ev->evtype == XI_TouchEnd)
-              event->button.type = (ev->evtype == XI_TouchBegin) ? GDK_TOUCH_PRESS : GDK_TOUCH_RELEASE;
+            if (ev->evtype == XI_TouchBegin)
+              event->button.type = GDK_TOUCH_PRESS;
+	    else if (ev->evtype == XI_TouchEnd)
+              event->button.type = GDK_TOUCH_RELEASE;
             else
 #endif /* XINPUT_2_1 */
               event->button.type = (ev->evtype == XI_ButtonPress) ? GDK_BUTTON_PRESS : GDK_BUTTON_RELEASE;
@@ -1239,14 +1239,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
       }
     case XI_Motion:
 #ifdef XINPUT_2_1
-    case XI_TouchMotion:
-    case XI_TouchMotionUnowned:
-      /* FIXME: Unowned events should be rollback-able,
-       * the easiest way to go could be just storing the
-       * events so they can be replayed in arrival order
-       * when an ownership event arrives, needs further
-       * investigation though.
-       */
+    case XI_TouchUpdate:
 #endif /* XINPUT_2_1 */
       {
         XIDeviceEvent *xev = (XIDeviceEvent *) ev;



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