[gnome-shell] grabHelper: handle touch events during grab modality



commit 42b54aaa2170312d97730d84393866657a783706
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Jul 24 18:31:51 2014 +0200

    grabHelper: handle touch events during grab modality
    
    The "pointer emulating" touch sequence will be handled in order to dismiss
    the grab, while the others are just propagated.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=733633

 js/ui/grabHelper.js |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/grabHelper.js b/js/ui/grabHelper.js
index c5f76c8..4474e49 100644
--- a/js/ui/grabHelper.js
+++ b/js/ui/grabHelper.js
@@ -288,8 +288,16 @@ const GrabHelper = new Lang.Class({
         let release = type == Clutter.EventType.BUTTON_RELEASE;
         let button = press || release;
 
-        if (this._ignoreUntilRelease && (motion || release)) {
-            if (release)
+        let touchUpdate = type == Clutter.EventType.TOUCH_UPDATE;
+        let touchBegin = type == Clutter.EventType.TOUCH_BEGIN;
+        let touchEnd = type == Clutter.EventType.TOUCH_END;
+        let touch = touchUpdate || touchBegin || touchEnd;
+
+        if (touch && !global.display.is_pointer_emulating_sequence (event.get_event_sequence()))
+            return Clutter.EVENT_PROPAGATE;
+
+        if (this._ignoreUntilRelease && (motion || release || touch)) {
+            if (release || touchEnd)
                 this._ignoreUntilRelease = false;
             return Clutter.EVENT_STOP;
         }
@@ -300,10 +308,10 @@ const GrabHelper = new Lang.Class({
         if (Main.keyboard.shouldTakeEvent(event))
             return Clutter.EVENT_PROPAGATE;
 
-        if (button) {
+        if (button || touchBegin) {
             // If we have a press event, ignore the next
             // motion/release events.
-            if (press)
+            if (press || touchBegin)
                 this._ignoreUntilRelease = true;
 
             let i = this._actorInGrabStack(event.get_source()) + 1;


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