From 87562db74d62b141e06b372db583594940eebba1 Mon Sep 17 00:00:00 2001 From: Dario Freddi Date: Sun, 22 Feb 2015 15:26:47 +0100 Subject: [PATCH] evdev: Do not fail when ABS_MT_SLOT is not defined. This is pretty much the same behavior found in xf86-input-evdev. Without this patch, some perfectly usable Protocol A touchscreens were erroneously discarded. --- src/evdev.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/evdev.c b/src/evdev.c index 6e318dc..e11cc39 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -1412,8 +1412,13 @@ evdev_configure_device(struct evdev_device *device) num_slots = device->mtdev->caps.slot.maximum; if (device->mtdev->caps.slot.minimum < 0 || - num_slots <= 0) - return -1; + num_slots <= 0) { + // If mtdev does not find any ABS_MT_SLOT, the TS is still + // perfectly usable. + log_info(libinput, + "No slots found on device, going on anyway.\n"); + num_slots = 1; + } active_slot = device->mtdev->caps.slot.value; } else { num_slots = libevdev_get_num_slots(device->evdev); -- 2.1.0