summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2020-02-27 14:48:28 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2020-03-05 16:35:53 +1000
commitcd5af1a4f6a58c9544e863bbe379cdc47b3d73d1 (patch)
treeb67f6011370555164dbc10eec1f84c99b0ba1069
parentc7f06b0bdd0de7cd0cd4946b055cf142588ed493 (diff)
downloadlibinput-cd5af1a4f6a58c9544e863bbe379cdc47b3d73d1.tar.gz
touchpad: only reduce the slot count for ALPS serial touchpads
We're getting too many regressions on other devices for this feature and only ALPS touchpads need it (it's a kernel driver bug). So let's limit this to those devices only. For example, synaptics serial touchpads don't keep the fake fingers and slot states in sync when going from two to three fingers, causing an erroneous slot downgrade. See https://gitlab.freedesktop.org/libinput/libinput/issues/434#note_419912 That interferes with this code but fixing it is hard and anyway, synaptics touchpads don't need the slot count drop. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/evdev-mt-touchpad.c7
-rw-r--r--src/evdev.c1
-rw-r--r--src/evdev.h1
3 files changed, 7 insertions, 2 deletions
diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index 99880299..c3da8f9d 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -645,12 +645,14 @@ tp_process_fake_touches(struct tp_dispatch *tp,
EVDEV_MODEL_SYNAPTICS_SERIAL_TOUCHPAD)
tp_restore_synaptics_touches(tp, time);
- /* ALPS touchpads always set 3 slots in the kernel, even
+ /* ALPS serial touchpads always set 3 slots in the kernel, even
* where they support less than that. So we get BTN_TOOL_TRIPLETAP
* but never slot 2 because our slot count is wrong.
* This also means that the third touch falls through the cracks and
* is ignored.
*
+ * See https://gitlab.freedesktop.org/libinput/libinput/issues/408
+ *
* All touchpad devices have at least one slot so we only do this
* for 2 touches or higher.
*
@@ -665,7 +667,8 @@ tp_process_fake_touches(struct tp_dispatch *tp,
* For a long explanation of what happens, see
* https://gitlab.freedesktop.org/libevdev/libevdev/merge_requests/19
*/
- if (nfake_touches > 1 && tp->has_mt &&
+ if (tp->device->model_flags & EVDEV_MODEL_ALPS_SERIAL_TOUCHPAD &&
+ nfake_touches > 1 && tp->has_mt &&
tp->nactive_slots > 0 &&
nfake_touches > tp->nactive_slots &&
tp->nactive_slots < tp->num_slots) {
diff --git a/src/evdev.c b/src/evdev.c
index bf85aa24..3f4e6aac 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1384,6 +1384,7 @@ evdev_read_model_flags(struct evdev_device *device)
#define MODEL(name) { QUIRK_MODEL_##name, EVDEV_MODEL_##name }
MODEL(WACOM_TOUCHPAD),
MODEL(SYNAPTICS_SERIAL_TOUCHPAD),
+ MODEL(ALPS_SERIAL_TOUCHPAD),
MODEL(LENOVO_T450_TOUCHPAD),
MODEL(TRACKBALL),
MODEL(APPLE_TOUCHPAD_ONEBUTTON),
diff --git a/src/evdev.h b/src/evdev.h
index e95f7e60..0eda22f9 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -108,6 +108,7 @@ enum evdev_device_model {
EVDEV_MODEL_DEFAULT = 0,
EVDEV_MODEL_WACOM_TOUCHPAD = bit(1),
EVDEV_MODEL_SYNAPTICS_SERIAL_TOUCHPAD = bit(2),
+ EVDEV_MODEL_ALPS_SERIAL_TOUCHPAD = bit(3),
EVDEV_MODEL_LENOVO_T450_TOUCHPAD = bit(4),
EVDEV_MODEL_APPLE_TOUCHPAD_ONEBUTTON = bit(5),
EVDEV_MODEL_LENOVO_SCROLLPOINT = bit(6),