summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2014-07-08 13:02:31 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2014-07-09 12:49:15 +1000
commit468e6288082ee61ac6a4663726a2728e413804e1 (patch)
tree1f6a5a0dff3d633b003657cebc0244275e437019
parent14ba84cdca6776772e50efd3753ac01080317669 (diff)
downloadlibinput-468e6288082ee61ac6a4663726a2728e413804e1.tar.gz
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>
-rw-r--r--src/evdev-mt-touchpad.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index 0b06810c..4f4633d7 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -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;