diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2015-03-04 14:46:29 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2015-03-05 19:07:28 +1000 |
commit | 7ec0bf7ae2e3753d7e4989495bae80057f39508e (patch) | |
tree | b55d59cfb6725434edcaadd918f89d81b1a9cd8a /src | |
parent | 2ffd8d14be6e713e7f26b8b220da076171efe427 (diff) |
Up the scroll dist value for touchpads
For source FINGER and CONTINUOUS, the axis value is the same as relative
motion - but scrolling in X usually doesn't have the same speed as finger
movement, it's a lot coarser.
We don't know ahead of time where we'll get the scroll events from. Set a
default scroll distance of 15 and multiply any wheel clicks we get by this
value.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/libinput.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/libinput.c b/src/libinput.c index 049c15b..5e616c8 100644 --- a/src/libinput.c +++ b/src/libinput.c @@ -756,18 +756,22 @@ xf86libinput_handle_axis(InputInfoPtr pInfo, struct libinput_event_pointer *even axis = LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL; if (libinput_event_pointer_has_axis(event, axis)) { - if (source == LIBINPUT_POINTER_AXIS_SOURCE_WHEEL) + if (source == LIBINPUT_POINTER_AXIS_SOURCE_WHEEL) { value = libinput_event_pointer_get_axis_value_discrete(event, axis); - else + value *= driver_data->scroll_vdist; + } else { value = libinput_event_pointer_get_axis_value(event, axis); + } valuator_mask_set_double(mask, 3, value); } axis = LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL; if (libinput_event_pointer_has_axis(event, axis)) { - if (source == LIBINPUT_POINTER_AXIS_SOURCE_WHEEL) + if (source == LIBINPUT_POINTER_AXIS_SOURCE_WHEEL) { value = libinput_event_pointer_get_axis_value_discrete(event, axis); - else + value *= driver_data->scroll_hdist; + } else { value = libinput_event_pointer_get_axis_value(event, axis); + } valuator_mask_set_double(mask, 2, value); } @@ -1189,8 +1193,8 @@ xf86libinput_pre_init(InputDriverPtr drv, if (!driver_data->valuators) goto fail; - driver_data->scroll_vdist = 1; - driver_data->scroll_hdist = 1; + driver_data->scroll_vdist = 15; + driver_data->scroll_hdist = 15; path = xf86SetStrOption(pInfo->options, "Device", NULL); if (!path) |