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>
This commit is contained in:
tokyo4j 2025-04-05 11:38:01 +09:00
parent e9f3fc080c
commit cc0889bf2b

View file

@ -1718,17 +1718,9 @@ 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);
}
}
static void
tp_gesture_handle_state_3fg_drag_released(struct tp_dispatch *tp,