From cc0889bf2b0e37b4f3b792cc38f1141e217e9eaa Mon Sep 17 00:00:00 2001 From: tokyo4j Date: Sat, 5 Apr 2025 11:38:01 +0900 Subject: [PATCH] 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: --- 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