[PATCH libinput] touchpad: only pair tracksticks with touchpads where needed

Peter Hutterer peter.hutterer at who-t.net
Thu May 28 20:16:36 PDT 2015


On topbuttonpads we need the trackstick pairing to generate the right software
buttons, on the X1 Carbon-like devices we need the pairing to route the
buttons correctly (though this code is obsolete with newer kernels).

This fixes the touchpad being unresponsive while the trackpoint is in use.

https://bugs.freedesktop.org/show_bug.cgi?id=90731

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/evdev-mt-touchpad.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index eacec6e..f8593a9 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -1060,11 +1060,17 @@ tp_interface_device_added(struct evdev_device *device,
 	unsigned int bus_tp = libevdev_get_id_bustype(device->evdev),
 		     bus_trp = libevdev_get_id_bustype(added_device->evdev);
 	bool tp_is_internal, trp_is_internal;
+	bool want_trackpoint_pairing = false;
 
 	tp_is_internal = bus_tp != BUS_USB && bus_tp != BUS_BLUETOOTH;
 	trp_is_internal = bus_trp != BUS_USB && bus_trp != BUS_BLUETOOTH;
 
-	if (tp->buttons.trackpoint == NULL &&
+	if (tp->buttons.has_topbuttons ||
+	    device->tags & EVDEV_TAG_TOUCHPAD_TRACKPOINT)
+		want_trackpoint_pairing = true;
+
+	if (want_trackpoint_pairing &&
+	    tp->buttons.trackpoint == NULL &&
 	    (added_device->tags & EVDEV_TAG_TRACKPOINT) &&
 	    tp_is_internal && trp_is_internal) {
 		/* Don't send any pending releases to the new trackpoint */
-- 
2.4.1



More information about the wayland-devel mailing list