mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-01-19 21:10:27 +01:00
touchpad: don't feed 0/0 deltas into the accel filters
The resolution-based scaling may result in deltas of 0. The accel code doesn't handle 0 deltas too well. 0/0 deltas can't happen for EV_REL devices, so the code just isn't designed for it. Most notably, events with delta 0/0 have no direction. That messes up the history-based velocity calculation which stops whenever the current vector's direction changes from the one in the trackers. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
parent
14ba84cdca
commit
468e628808
1 changed files with 2 additions and 1 deletions
|
|
@ -63,7 +63,8 @@ tp_filter_motion(struct tp_dispatch *tp,
|
|||
motion.dx = *dx * tp->accel.x_scale_coeff;
|
||||
motion.dy = *dy * tp->accel.y_scale_coeff;
|
||||
|
||||
filter_dispatch(tp->filter, &motion, tp, time);
|
||||
if (motion.dx != 0.0 || motion.dy != 0.0)
|
||||
filter_dispatch(tp->filter, &motion, tp, time);
|
||||
|
||||
*dx = motion.dx;
|
||||
*dy = motion.dy;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue