xf86-input-libinput 0.11.0
- support buttons higher than BTN_BACK (1230945)
This commit is contained in:
parent
c799754845
commit
039869f2af
1
.gitignore
vendored
1
.gitignore
vendored
@ -8,3 +8,4 @@
|
||||
/xf86-input-libinput-0.8.0.tar.bz2
|
||||
/xf86-input-libinput-0.9.0.tar.bz2
|
||||
/xf86-input-libinput-0.10.0.tar.bz2
|
||||
/xf86-input-libinput-0.11.0.tar.bz2
|
||||
|
@ -1,32 +0,0 @@
|
||||
From d4e0b5420ff2af2e790f12d10996f93ec6066b4a Mon Sep 17 00:00:00 2001
|
||||
From: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Date: Mon, 1 Jun 2015 11:41:09 +1000
|
||||
Subject: [PATCH xf86-input-libinput] Fix missing scroll methods default/scroll
|
||||
button property
|
||||
|
||||
Even if no scroll method is enabled by default, we still want those
|
||||
properties.
|
||||
|
||||
Introduced in 8d4e03570c.
|
||||
|
||||
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
---
|
||||
src/libinput.c | 3 ---
|
||||
1 file changed, 3 deletions(-)
|
||||
|
||||
diff --git a/src/libinput.c b/src/libinput.c
|
||||
index 3cc4426..595b177 100644
|
||||
--- a/src/libinput.c
|
||||
+++ b/src/libinput.c
|
||||
@@ -2242,9 +2242,6 @@ LibinputInitScrollMethodsProperty(DeviceIntPtr dev,
|
||||
return;
|
||||
|
||||
scroll_methods = libinput_device_config_scroll_get_default_method(device);
|
||||
- if (scroll_methods == LIBINPUT_CONFIG_SCROLL_NO_SCROLL)
|
||||
- return;
|
||||
-
|
||||
if (scroll_methods & LIBINPUT_CONFIG_SCROLL_2FG)
|
||||
methods[0] = TRUE;
|
||||
if (scroll_methods & LIBINPUT_CONFIG_SCROLL_EDGE)
|
||||
--
|
||||
2.4.1
|
@ -1,73 +0,0 @@
|
||||
From 3d6afca975e5c54d458974ca2e9ada3df209587c Mon Sep 17 00:00:00 2001
|
||||
From: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Date: Wed, 20 May 2015 13:22:45 +1000
|
||||
Subject: [PATCH xf86-input-libinput] Only init abs axes if we don't have
|
||||
acceleration
|
||||
|
||||
A lot of devices (mainly MS input devices) have abs axes on top of the
|
||||
relative axes. Those axes are usually mute but with the current code we set up
|
||||
absolute axes for those devices. Relative events are then scaled by the server
|
||||
which makes the device appear slow.
|
||||
|
||||
As an immediate fix always prefer relative axes and only set up absolute axes
|
||||
if the device has a calibration matrix but no pointer acceleration.
|
||||
This may mess up other devices where the relative axes are dead, we'll deal
|
||||
with this when it comes.
|
||||
|
||||
https://bugs.freedesktop.org/show_bug.cgi?id=90322
|
||||
|
||||
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
|
||||
---
|
||||
src/libinput.c | 14 +++++++++++++-
|
||||
1 file changed, 13 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/libinput.c b/src/libinput.c
|
||||
index 3e54529..c8669fc 100644
|
||||
--- a/src/libinput.c
|
||||
+++ b/src/libinput.c
|
||||
@@ -85,6 +85,8 @@ struct xf86libinput {
|
||||
double y_remainder;
|
||||
} scale;
|
||||
|
||||
+ BOOL has_abs;
|
||||
+
|
||||
ValuatorMask *valuators;
|
||||
|
||||
struct options {
|
||||
@@ -526,6 +528,8 @@ xf86libinput_init_pointer_absolute(InputInfoPtr pInfo)
|
||||
SetScrollValuator(dev, 2, SCROLL_TYPE_HORIZONTAL, driver_data->scroll.hdist, 0);
|
||||
SetScrollValuator(dev, 3, SCROLL_TYPE_VERTICAL, driver_data->scroll.vdist, 0);
|
||||
|
||||
+ driver_data->has_abs = TRUE;
|
||||
+
|
||||
return Success;
|
||||
}
|
||||
static void
|
||||
@@ -636,7 +640,8 @@ xf86libinput_init(DeviceIntPtr dev)
|
||||
if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_KEYBOARD))
|
||||
xf86libinput_init_keyboard(pInfo);
|
||||
if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_POINTER)) {
|
||||
- if (libinput_device_config_calibration_has_matrix(device))
|
||||
+ if (libinput_device_config_calibration_has_matrix(device) &&
|
||||
+ !libinput_device_config_accel_is_available(device))
|
||||
xf86libinput_init_pointer_absolute(pInfo);
|
||||
else
|
||||
xf86libinput_init_pointer(pInfo);
|
||||
@@ -709,6 +714,13 @@ xf86libinput_handle_absmotion(InputInfoPtr pInfo, struct libinput_event_pointer
|
||||
ValuatorMask *mask = driver_data->valuators;
|
||||
double x, y;
|
||||
|
||||
+ if (!driver_data->has_abs) {
|
||||
+ xf86IDrvMsg(pInfo, X_ERROR,
|
||||
+ "Discarding absolute event from relative device. "
|
||||
+ "Please file a bug\n");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
x = libinput_event_pointer_get_absolute_x_transformed(event, TOUCH_AXIS_MAX);
|
||||
y = libinput_event_pointer_get_absolute_y_transformed(event, TOUCH_AXIS_MAX);
|
||||
|
||||
--
|
||||
2.3.5
|
||||
|
28
0001-Support-buttons-BTN_BACK-on-mice.patch
Normal file
28
0001-Support-buttons-BTN_BACK-on-mice.patch
Normal file
@ -0,0 +1,28 @@
|
||||
From 9c5cf971439292661e1f3055ef882526baae6310 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Date: Mon, 15 Jun 2015 10:17:20 +1000
|
||||
Subject: [PATCH xf86-input-libinput] Support buttons > BTN_BACK on mice
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1230945
|
||||
|
||||
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
---
|
||||
src/libinput.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/libinput.c b/src/libinput.c
|
||||
index 595b177..a06e44f 100644
|
||||
--- a/src/libinput.c
|
||||
+++ b/src/libinput.c
|
||||
@@ -456,7 +456,7 @@ xf86libinput_init_pointer(InputInfoPtr pInfo)
|
||||
Atom btnlabels[MAX_BUTTONS];
|
||||
Atom axislabels[TOUCHPAD_NUM_AXES];
|
||||
|
||||
- for (i = BTN_BACK; i >= BTN_SIDE; i--) {
|
||||
+ for (i = BTN_JOYSTICK - 1; i >= BTN_SIDE; i--) {
|
||||
if (libinput_device_pointer_has_button(driver_data->device, i)) {
|
||||
nbuttons += i - BTN_SIDE + 1;
|
||||
break;
|
||||
--
|
||||
2.4.3
|
||||
|
@ -1,91 +0,0 @@
|
||||
From 19c91044e44dd31deaeb638a919c64e9a9182448 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Date: Tue, 5 May 2015 14:17:10 +1000
|
||||
Subject: [PATCH xf86-input-libinput] Use the new unaccelerated valuator
|
||||
ValuatorMask features
|
||||
|
||||
SDL Games like openarena rely on relative input that's handled by the DGA code
|
||||
in the server. That code casts the driver's input data to int and sends it to
|
||||
the client. libinput does pointer acceleration for us, so sending any deltas
|
||||
of less than 1 (likely for slow movements) ends up being 0.
|
||||
|
||||
Use the new ValuatorMask accelerated/unaccelerated values to pass the
|
||||
unaccelerated values along, the server can then decide what to do with it.
|
||||
|
||||
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
|
||||
---
|
||||
src/libinput.c | 27 ++++++++++++++++++++++++++-
|
||||
1 file changed, 26 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/libinput.c b/src/libinput.c
|
||||
index c8669fc..3cc4426 100644
|
||||
--- a/src/libinput.c
|
||||
+++ b/src/libinput.c
|
||||
@@ -47,6 +47,12 @@
|
||||
#define XI86_SERVER_FD 0x20
|
||||
#endif
|
||||
|
||||
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) * 1000 + GET_ABI_MINOR(ABI_XINPUT_VERSION) > 21000
|
||||
+#define HAVE_VMASK_UNACCEL 1
|
||||
+#else
|
||||
+#undef HAVE_VMASK_UNACCEL
|
||||
+#endif
|
||||
+
|
||||
#define TOUCHPAD_NUM_AXES 4 /* x, y, hscroll, vscroll */
|
||||
#define TOUCH_MAX_SLOTS 15
|
||||
#define XORG_KEYCODE_OFFSET 8
|
||||
@@ -88,6 +94,7 @@ struct xf86libinput {
|
||||
BOOL has_abs;
|
||||
|
||||
ValuatorMask *valuators;
|
||||
+ ValuatorMask *valuators_unaccelerated;
|
||||
|
||||
struct options {
|
||||
BOOL tapping;
|
||||
@@ -700,9 +707,21 @@ xf86libinput_handle_motion(InputInfoPtr pInfo, struct libinput_event_pointer *ev
|
||||
y = libinput_event_pointer_get_dy(event);
|
||||
|
||||
valuator_mask_zero(mask);
|
||||
+
|
||||
+#if HAVE_VMASK_UNACCEL
|
||||
+ {
|
||||
+ double ux, uy;
|
||||
+
|
||||
+ ux = libinput_event_pointer_get_dx_unaccelerated(event);
|
||||
+ uy = libinput_event_pointer_get_dy_unaccelerated(event);
|
||||
+
|
||||
+ valuator_mask_set_unaccelerated(mask, 0, x, ux);
|
||||
+ valuator_mask_set_unaccelerated(mask, 1, y, uy);
|
||||
+ }
|
||||
+#else
|
||||
valuator_mask_set_double(mask, 0, x);
|
||||
valuator_mask_set_double(mask, 1, y);
|
||||
-
|
||||
+#endif
|
||||
xf86PostMotionEventM(dev, Relative, mask);
|
||||
}
|
||||
|
||||
@@ -1363,6 +1382,10 @@ xf86libinput_pre_init(InputDriverPtr drv,
|
||||
if (!driver_data->valuators)
|
||||
goto fail;
|
||||
|
||||
+ driver_data->valuators_unaccelerated = valuator_mask_new(2);
|
||||
+ if (!driver_data->valuators_unaccelerated)
|
||||
+ goto fail;
|
||||
+
|
||||
driver_data->scroll.vdist = 15;
|
||||
driver_data->scroll.hdist = 15;
|
||||
|
||||
@@ -1434,6 +1457,8 @@ fail:
|
||||
fd_pop(&driver_context, pInfo->fd);
|
||||
if (driver_data->valuators)
|
||||
valuator_mask_free(&driver_data->valuators);
|
||||
+ if (driver_data->valuators_unaccelerated)
|
||||
+ valuator_mask_free(&driver_data->valuators_unaccelerated);
|
||||
free(path);
|
||||
free(driver_data);
|
||||
return BadValue;
|
||||
--
|
||||
2.4.1
|
||||
|
2
sources
2
sources
@ -1 +1 @@
|
||||
e0d6fc2aceba154e57501d36e361d3f7 xf86-input-libinput-0.10.0.tar.bz2
|
||||
710f0a2ecb6a3aefee80aba0fbbe6e18 xf86-input-libinput-0.11.0.tar.bz2
|
||||
|
@ -4,18 +4,16 @@
|
||||
|
||||
Summary: Xorg X11 libinput input driver
|
||||
Name: xorg-x11-drv-libinput
|
||||
Version: 0.10.0
|
||||
Release: 5%{?dist}
|
||||
Version: 0.11.0
|
||||
Release: 1%{?dist}
|
||||
URL: http://www.x.org
|
||||
License: MIT
|
||||
|
||||
Source0: ftp://ftp.x.org/pub/individual/driver/%{tarball}-%{version}.tar.bz2
|
||||
Source1: 90-libinput.conf
|
||||
|
||||
Patch01: 0001-Only-init-abs-axes-if-we-don-t-have-acceleration.patch
|
||||
# Bug 1208992 - Mouse cursor doesn't move when moving the physical mouse slowly
|
||||
Patch02: 0001-Use-the-new-unaccelerated-valuator-ValuatorMask-feat.patch
|
||||
Patch03: 0001-Fix-missing-scroll-methods-default-scroll-button-pro.patch
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1230945
|
||||
Patch01: 0001-Support-buttons-BTN_BACK-on-mice.patch
|
||||
|
||||
ExcludeArch: s390 s390x
|
||||
|
||||
@ -39,8 +37,6 @@ supporting all devices.
|
||||
%prep
|
||||
%setup -q -n %{tarball}-%{version}
|
||||
%patch01 -p1
|
||||
%patch02 -p1
|
||||
%patch03 -p1
|
||||
|
||||
%build
|
||||
autoreconf --force -v --install || exit 1
|
||||
@ -76,6 +72,10 @@ Xorg X11 libinput input driver development files.
|
||||
%{_includedir}/xorg/libinput-properties.h
|
||||
|
||||
%changelog
|
||||
* Mon Jun 15 2015 Peter Hutterer <peter.hutterer@redhat.com> 0.11.0-1
|
||||
- xf86-input-libinput 0.11.0
|
||||
- support buttons higher than BTN_BACK (1230945)
|
||||
|
||||
* Mon Jun 01 2015 Peter Hutterer <peter.hutterer@redhat.com> 0.10.0-5
|
||||
- Fix missing scroll button property
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user