From bee8989c741d693cd7adb20235cd05beb3cd90e0 Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Mon, 17 Feb 2014 18:22:17 -0500 Subject: [PATCH] Fix scrolling jumps libinput currently scales wheel events by DEFAULT_AXIS_STEP_DISTANCE, which is currently 10. We may be able to find the value automatically, but it would require some dark codings that may not be robust. For the time being, just duplicate the define in libinput.c and remember to update it if it is changed in the future. Signed-off-by: Benjamin Tissoires Signed-off-by: Peter Hutterer --- src/libinput.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/libinput.c b/src/libinput.c index 5053533..9b08071 100644 --- a/src/libinput.c +++ b/src/libinput.c @@ -51,6 +51,12 @@ */ #define TOUCH_AXIS_MAX 0xffff +/* + libinput scales wheel events by DEFAULT_AXIS_STEP_DISTANCE, which is + currently 10. + */ +#define DEFAULT_LIBINPUT_AXIS_STEP_DISTANCE 10 + struct xf86libinput_driver { struct libinput *libinput; int device_count; @@ -390,7 +396,7 @@ xf86libinput_handle_axis(InputInfoPtr pInfo, struct libinput_event_pointer *even else axis = 4; - value = libinput_event_pointer_get_axis_value(event); + value = libinput_event_pointer_get_axis_value(event) / DEFAULT_LIBINPUT_AXIS_STEP_DISTANCE; xf86PostMotionEvent(dev, Relative, axis, 1, li_fixed_to_int(value)); }