[mutter] display: Implement gesture-induced touch cancellation for wayland



commit 25b6a40ad462e4368a2a80a0dafbcd4a8e54bcd0
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Jul 22 01:46:42 2014 +0200

    display: Implement gesture-induced touch cancellation for wayland
    
    On wayland, touches are initially both handled by the compositor and sent
    to clients, proceeding to cancellation on clients only after the compositor
    claims the sequence for itself. Implement the cancellation detail through
    MetaGestureTracker::state-changed.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=733631

 src/core/display.c |   34 +++++++++++++++++++++-------------
 1 files changed, 21 insertions(+), 13 deletions(-)
---
diff --git a/src/core/display.c b/src/core/display.c
index 3ded1d4..6804032 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -467,20 +467,28 @@ gesture_tracker_state_changed (MetaGestureTracker   *tracker,
                                MetaSequenceState     state,
                                MetaDisplay          *display)
 {
-  MetaBackendX11 *backend = META_BACKEND_X11 (meta_get_backend ());
-  int event_mode;
-
-  if (state == META_SEQUENCE_ACCEPTED)
-    event_mode = XIAcceptTouch;
-  else if (state == META_SEQUENCE_REJECTED)
-    event_mode = XIRejectTouch;
+  if (meta_is_wayland_compositor ())
+    {
+      if (state == META_SEQUENCE_ACCEPTED)
+        meta_display_cancel_touch (display);
+    }
   else
-    return;
+    {
+      MetaBackendX11 *backend = META_BACKEND_X11 (meta_get_backend ());
+      int event_mode;
 
-  XIAllowTouchEvents (meta_backend_x11_get_xdisplay (backend),
-                      META_VIRTUAL_CORE_POINTER_ID,
-                      clutter_x11_event_sequence_get_touch_detail (sequence),
-                      DefaultRootWindow (display->xdisplay), event_mode);
+      if (state == META_SEQUENCE_ACCEPTED)
+        event_mode = XIAcceptTouch;
+      else if (state == META_SEQUENCE_REJECTED)
+        event_mode = XIRejectTouch;
+      else
+        return;
+
+      XIAllowTouchEvents (meta_backend_x11_get_xdisplay (backend),
+                          META_VIRTUAL_CORE_POINTER_ID,
+                          clutter_x11_event_sequence_get_touch_detail (sequence),
+                          DefaultRootWindow (display->xdisplay), event_mode);
+    }
 }
 
 /**


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