Fix two-finger scrolling speed (#1198467)

This commit is contained in:
Peter Hutterer 2015-03-05 19:05:08 +10:00
parent f83807cc8e
commit 3e6445099d
2 changed files with 69 additions and 1 deletions

View File

@ -0,0 +1,63 @@
From b6731d3d899e7bb7c64652655faba243dcf1aae6 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Wed, 4 Mar 2015 14:46:29 +1000
Subject: [PATCH xf86-input-libinput] 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>
---
src/libinput.c | 16 ++++++++++------
1 file 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)
--
2.1.0

View File

@ -5,7 +5,7 @@
Summary: Xorg X11 libinput input driver
Name: xorg-x11-drv-libinput
Version: 0.7.0
Release: 4%{?dist}
Release: 5%{?dist}
URL: http://ww.x.org
License: MIT
@ -14,6 +14,7 @@ Source1: 90-libinput.conf
Patch01: 0001-Fix-off-by-one-error-in-buttonmap-initialization-893.patch
Patch02: 0001-Ignore-property-changes-if-the-device-is-disabled.patch
Patch03: 0001-Up-the-scroll-dist-value-for-touchpads.patch
ExcludeArch: s390 s390x
@ -35,6 +36,7 @@ supporting all devices.
%setup -q -n %{tarball}-%{version}
%patch01 -p1
%patch02 -p1
%patch03 -p1
%build
autoreconf --force -v --install || exit 1
@ -70,6 +72,9 @@ Xorg X11 libinput input driver development files.
%{_includedir}/xorg/libinput-properties.h
%changelog
* Thu Mar 05 2015 Peter Hutterer <peter.hutterer@redhat.com> 0.7.0-5
- Fix two-finger scrolling speed (#1198467)
* Thu Feb 26 2015 Peter Hutterer <peter.hutterer@redhat.com> 0.7.0-4
- Fix property setting patch, first version prevented re-enabling a device.