mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-28 22:30:07 +01:00
gestures: Filter unaccelerated deltas for gestures
Make sure the unaccelerated deltas are comparable to scroll deltas. edit by whot: The original intention of the unaccelerated motion data here was to provide both accelerated and unaccelerated motion for gestures so it was possible to have 1:1 mapping from gesture motion to screen activity. Normalizing to 1000dpi this way would've worked for mice but touchpad acceleration also includes the TP_MAGIC_SLOWDOWN (amongst other tricks) which slows down motion to around 27% *before* applying the acceleration function. On a 1000dpi touchpad (~40 units/mm) simply normalizing touchpad motion to 1000dpi results in pointer motion that is way too fast, it's lacking that slowdown to 27% of original speed. This results in the accelerated and unaccelerated gesture data being in effectively two different coordinate systems with the caller having no ability to relate the two. Switching to the special constant acceleration applies that slowdown and matches the data to the part of the acceleration curve where no (additional) acceleration is applied. It makes the gesture unaccelerated data comparable to the accelerated data and to scroll data which uses the same process. Fixes #582 Signed-off-by: Alexander Mikhaylenko <alexm@gnome.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
1d9cdf76a5
commit
60d5172e15
1 changed files with 2 additions and 2 deletions
|
|
@ -636,7 +636,7 @@ tp_gesture_handle_state_swipe(struct tp_dispatch *tp, uint64_t time)
|
|||
delta = tp_filter_motion(tp, &raw, time);
|
||||
|
||||
if (!normalized_is_zero(delta) || !device_float_is_zero(raw)) {
|
||||
unaccel = tp_normalize_delta(tp, raw);
|
||||
unaccel = tp_filter_motion_unaccelerated(tp, &raw, time);
|
||||
tp_gesture_start(tp, time);
|
||||
gesture_notify_swipe(&tp->device->base, time,
|
||||
LIBINPUT_EVENT_GESTURE_SWIPE_UPDATE,
|
||||
|
|
@ -674,7 +674,7 @@ tp_gesture_handle_state_pinch(struct tp_dispatch *tp, uint64_t time)
|
|||
scale == tp->gesture.prev_scale && angle_delta == 0.0)
|
||||
return GESTURE_STATE_PINCH;
|
||||
|
||||
unaccel = tp_normalize_delta(tp, fdelta);
|
||||
unaccel = tp_filter_motion_unaccelerated(tp, &fdelta, time);
|
||||
tp_gesture_start(tp, time);
|
||||
gesture_notify_pinch(&tp->device->base, time,
|
||||
LIBINPUT_EVENT_GESTURE_PINCH_UPDATE,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue