[gnome-shell/wip/fmuellner/ws-gesture-animations: 1/4] windowManager: Allow disabling touchpad workspace switch action



commit f5438e23cd905589a087f917d23a59988443fd18
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed Mar 20 17:03:27 2019 +0000

    windowManager: Allow disabling touchpad workspace switch action
    
    Just like actual ClutterActions, it can make sense to temporarily
    disable the touchpad action, so add an appropriate property.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/issues/516

 js/ui/windowManager.js | 12 ++++++++++++
 1 file changed, 12 insertions(+)
---
diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js
index ea9493d6f..d61ec8599 100644
--- a/js/ui/windowManager.js
+++ b/js/ui/windowManager.js
@@ -459,10 +459,19 @@ var TouchpadWorkspaceSwitchAction = class {
     constructor(actor) {
         this._dx = 0;
         this._dy = 0;
+        this._enabled = true;
         actor.connect('captured-event', this._handleEvent.bind(this));
        this._touchpadSettings = new Gio.Settings({schema_id: 'org.gnome.desktop.peripherals.touchpad'});
     }
 
+    get enabled() {
+        return this._enabled;
+    }
+
+    set enabled(enabled) {
+        this._enabled = enabled;
+    }
+
     _checkActivated() {
         let dir;
 
@@ -493,6 +502,9 @@ var TouchpadWorkspaceSwitchAction = class {
         if ((allowedModes & Main.actionMode) == 0)
             return Clutter.EVENT_PROPAGATE;
 
+        if (!this._enabled)
+            return Clutter.EVENT_PROPAGATE;
+
         if (event.get_gesture_phase() == Clutter.TouchpadGesturePhase.UPDATE) {
             let [dx, dy] = event.get_gesture_motion_delta();
 


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