[packages/xorg-driver-input-libinput] - rel 2; add config and fixes from FC

arekm arekm at pld-linux.org
Wed Jun 3 14:35:55 CEST 2015


commit 8ad3d608fffc0768b7b5a3c28bcdd637868ab0b5
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Wed Jun 3 14:35:50 2015 +0200

    - rel 2; add config and fixes from FC

 ...-scroll-methods-default-scroll-button-pro.patch | 32 ++++++++
 ...it-abs-axes-if-we-don-t-have-acceleration.patch | 73 +++++++++++++++++
 ...-unaccelerated-valuator-ValuatorMask-feat.patch | 91 ++++++++++++++++++++++
 90-libinput.conf                                   | 29 +++++++
 xorg-driver-input-libinput.spec                    | 19 ++++-
 5 files changed, 242 insertions(+), 2 deletions(-)
---
diff --git a/xorg-driver-input-libinput.spec b/xorg-driver-input-libinput.spec
index e8feaa4..4c8666a 100644
--- a/xorg-driver-input-libinput.spec
+++ b/xorg-driver-input-libinput.spec
@@ -2,11 +2,17 @@ Summary:	A libinput-based X.org input driver
 Summary(pl.UTF-8):	Sterownik wejściowy X.org oparty na libinput
 Name:		xorg-driver-input-libinput
 Version:	0.10.0
-Release:	1
+Release:	2
 License:	MIT
 Group:		X11/Applications
 Source0:	http://xorg.freedesktop.org/releases/individual/driver/xf86-input-libinput-%{version}.tar.bz2
 # Source0-md5:	e0d6fc2aceba154e57501d36e361d3f7
+Source1:	90-libinput.conf
+# Source1-md5: xyz
+Patch0:		0001-Only-init-abs-axes-if-we-don-t-have-acceleration.patch
+# fedora Bug 1208992 - Mouse cursor doesn't move when moving the physical mouse slowly
+Patch1:		0001-Use-the-new-unaccelerated-valuator-ValuatorMask-feat.patch
+Patch2:		0001-Fix-missing-scroll-methods-default-scroll-button-pro.patch
 URL:		http://xorg.freedesktop.org/
 BuildRequires:	autoconf >= 2.60
 BuildRequires:	automake
@@ -46,6 +52,9 @@ Plik nagłówkowy sterownika libinput.
 
 %prep
 %setup -q -n xf86-input-libinput-%{version}
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
 
 %build
 %{__libtoolize}
@@ -60,9 +69,14 @@ Plik nagłówkowy sterownika libinput.
 
 %install
 rm -rf $RPM_BUILD_ROOT
+
+install -d $RPM_BUILD_ROOT/etc/X11/xorg.conf.d/
+
 %{__make} install \
 	DESTDIR=$RPM_BUILD_ROOT
 
+cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/X11/xorg.conf.d/90-libinput.conf
+
 %{__rm} $RPM_BUILD_ROOT%{_libdir}/xorg/modules/*/*.la
 
 %clean
@@ -70,7 +84,8 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc COPYING ChangeLog README.md conf/99-libinput.conf
+%doc COPYING ChangeLog README.md
+/etc/X11/xorg.conf.d/90-libinput.conf
 %attr(755,root,root) %{_libdir}/xorg/modules/input/libinput_drv.so
 %{_mandir}/man4/libinput.4*
 
diff --git a/0001-Fix-missing-scroll-methods-default-scroll-button-pro.patch b/0001-Fix-missing-scroll-methods-default-scroll-button-pro.patch
new file mode 100644
index 0000000..7cca722
--- /dev/null
+++ b/0001-Fix-missing-scroll-methods-default-scroll-button-pro.patch
@@ -0,0 +1,32 @@
+From d4e0b5420ff2af2e790f12d10996f93ec6066b4a Mon Sep 17 00:00:00 2001
+From: Peter Hutterer <peter.hutterer at 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 at 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
diff --git a/0001-Only-init-abs-axes-if-we-don-t-have-acceleration.patch b/0001-Only-init-abs-axes-if-we-don-t-have-acceleration.patch
new file mode 100644
index 0000000..e1103d2
--- /dev/null
+++ b/0001-Only-init-abs-axes-if-we-don-t-have-acceleration.patch
@@ -0,0 +1,73 @@
+From 3d6afca975e5c54d458974ca2e9ada3df209587c Mon Sep 17 00:00:00 2001
+From: Peter Hutterer <peter.hutterer at 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 at who-t.net>
+Reviewed-by: Hans de Goede <hdegoede at 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
+
diff --git a/0001-Use-the-new-unaccelerated-valuator-ValuatorMask-feat.patch b/0001-Use-the-new-unaccelerated-valuator-ValuatorMask-feat.patch
new file mode 100644
index 0000000..b2dacb5
--- /dev/null
+++ b/0001-Use-the-new-unaccelerated-valuator-ValuatorMask-feat.patch
@@ -0,0 +1,91 @@
+From 19c91044e44dd31deaeb638a919c64e9a9182448 Mon Sep 17 00:00:00 2001
+From: Peter Hutterer <peter.hutterer at 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 at who-t.net>
+Reviewed-by: Hans de Goede <hdegoede at 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
+
diff --git a/90-libinput.conf b/90-libinput.conf
new file mode 100644
index 0000000..1af2577
--- /dev/null
+++ b/90-libinput.conf
@@ -0,0 +1,29 @@
+# Match on all types of devices but tablet devices and joysticks
+
+Section "InputClass"
+        Identifier "libinput pointer catchall"
+        MatchIsPointer "on"
+        MatchDevicePath "/dev/input/event*"
+        Driver "libinput"
+EndSection
+
+Section "InputClass"
+        Identifier "libinput keyboard catchall"
+        MatchIsKeyboard "on"
+        MatchDevicePath "/dev/input/event*"
+        Driver "libinput"
+EndSection
+
+Section "InputClass"
+        Identifier "libinput touchpad catchall"
+        MatchIsTouchpad "on"
+        MatchDevicePath "/dev/input/event*"
+        Driver "libinput"
+EndSection
+
+Section "InputClass"
+        Identifier "libinput touchscreen catchall"
+        MatchIsTouchscreen "on"
+        MatchDevicePath "/dev/input/event*"
+        Driver "libinput"
+EndSection
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/xorg-driver-input-libinput.git/commitdiff/8ad3d608fffc0768b7b5a3c28bcdd637868ab0b5



More information about the pld-cvs-commit mailing list