From a2f47b61f67bd0616650afea9238c607bd64f5bf Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 18 Jan 2017 17:58:36 +1000 Subject: [PATCH libinput] filter: normalize deltas before returning them When the filter code switched to raw device coordinates (bdd4264d) the input data remained in device coordinates. Since the factor for touchpads was still based on the physical velocity (and thus all touchpads get the same acceleration factor for identical moves), the actual delta was dependent on the resolution. e.g. touchpad with 40u/mm: delta of 2/2 * accel factor 2 -> accel delta of 4/4 touchpad with 20u/mm: delta of 1/1 * accel factor 2 -> accel delta of 2/2 The normalized coordinates should be independent of the touchpad's resolution though. https://bugs.freedesktop.org/show_bug.cgi?id=99383 Signed-off-by: Peter Hutterer --- src/filter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/filter.c b/src/filter.c index d7a1515..9104888 100644 --- a/src/filter.c +++ b/src/filter.c @@ -416,7 +416,7 @@ accelerator_filter_generic(struct motion_filter *filter, struct pointer_accelerator *accel = (struct pointer_accelerator *) filter; double accel_value; /* unitless factor */ - struct normalized_coords accelerated; + struct device_float_coords accelerated; accel_value = calculate_acceleration_factor(accel, unaccelerated, @@ -426,7 +426,7 @@ accelerator_filter_generic(struct motion_filter *filter, accelerated.x = accel_value * unaccelerated->x; accelerated.y = accel_value * unaccelerated->y; - return accelerated; + return normalize_for_dpi(&accelerated, accel->dpi); } /** -- 2.9.3