[gnome-shell/wip/jimmac/dash-icon-spacing: 52/72] swipeTracker: Hack to make multiple trackers work
- From: Jakub Steiner <jimmac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/jimmac/dash-icon-spacing: 52/72] swipeTracker: Hack to make multiple trackers work
- Date: Tue, 2 Feb 2021 11:58:19 +0000 (UTC)
commit a621af7b2baa5fd1d02af9acb2250fb996072df4
Author: Florian Müllner <fmuellner gnome org>
Date: Wed Jun 10 01:45:08 2020 +0200
swipeTracker: Hack to make multiple trackers work
js/ui/swipeTracker.js | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/swipeTracker.js b/js/ui/swipeTracker.js
index 333bac1582..5b5417d159 100644
--- a/js/ui/swipeTracker.js
+++ b/js/ui/swipeTracker.js
@@ -102,6 +102,16 @@ const TouchpadSwipeGesture = GObject.registerClass({
let [x, y] = event.get_coords();
let [dx, dy] = event.get_gesture_motion_delta();
+ let gestureOrientation = -1;
+ if (dx !== dy) {
+ gestureOrientation = Math.abs(dx) > Math.abs(dy)
+ ? Clutter.Orientation.HORIZONTAL
+ : Clutter.Orientation.VERTICAL;
+ }
+
+ if (gestureOrientation >= 0 && gestureOrientation !== this._orientation)
+ return Clutter.EVENT_PROPAGATE;
+
let delta;
if (this._orientation === Clutter.Orientation.VERTICAL)
delta = dy / TOUCHPAD_BASE_HEIGHT;
@@ -126,7 +136,9 @@ const TouchpadSwipeGesture = GObject.registerClass({
break;
}
- return Clutter.EVENT_STOP;
+ return gestureOrientation === this._orientation
+ ? Clutter.EVENT_STOP
+ : Clutter.EVENT_PROPAGATE;
}
destroy() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]