summarylogtreecommitdiffstats
path: root/0001-gestures-fix-acceleration-in-3fg-drag.patch
blob: 06962bbfa2aa7b31f06e4c1bf1d75b94c547bb9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From 97cd908797bfa10da9e73888fbca9a19357856f2 Mon Sep 17 00:00:00 2001
From: tokyo4j <hrak1529@gmail.com>
Date: Sat, 5 Apr 2025 11:38:01 +0900
Subject: [PATCH 1/2] gestures: fix acceleration in 3fg drag

Before this patch, tp_filter_motion() was called twice in pointer motion
handler during 3fg drag, causing the pointer speed to be much faster
than during 1fg motion when the acceleration profile is adaptive.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1180>
---
 src/evdev-mt-touchpad-gestures.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/src/evdev-mt-touchpad-gestures.c b/src/evdev-mt-touchpad-gestures.c
index c429bd2c..39880eff 100644
--- a/src/evdev-mt-touchpad-gestures.c
+++ b/src/evdev-mt-touchpad-gestures.c
@@ -1718,16 +1718,8 @@ tp_gesture_handle_state_3fg_drag_start(struct tp_dispatch *tp, uint64_t time)
 static void
 tp_gesture_handle_state_3fg_drag(struct tp_dispatch *tp, uint64_t time)
 {
-	if (!(tp->queued & TOUCHPAD_EVENT_MOTION))
-		return;
-
-	struct device_float_coords raw = tp_get_average_touches_delta(tp);
-	struct normalized_coords delta = tp_filter_motion(tp, &raw, time);
-
-	if (!normalized_is_zero(delta) || !device_float_is_zero(raw)) {
-		if (tp->queued & TOUCHPAD_EVENT_MOTION)
-			tp_gesture_post_pointer_motion(tp, time);
-	}
+	if (tp->queued & TOUCHPAD_EVENT_MOTION)
+		tp_gesture_post_pointer_motion(tp, time);
 }
 
 static void
-- 
2.47.1