diff --git a/0001-touchpad-disable-MT-for-all-semi-mt-devices.patch b/0001-touchpad-disable-MT-for-all-semi-mt-devices.patch new file mode 100644 index 0000000..f653958 --- /dev/null +++ b/0001-touchpad-disable-MT-for-all-semi-mt-devices.patch @@ -0,0 +1,132 @@ +From 7c231b7a1223b099ed15c35d703c6b9d4af1ab44 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Tue, 19 Jan 2016 09:05:31 +1000 +Subject: [PATCH libinput] touchpad: disable MT for all semi-mt devices + +Synaptics, Elantech and Alps semi-mt devices all have issues with reporting +correct MT data, even the bounding box which semi-mt devices are supposed to +report is wrong. + +Synaptics devices have massive jumps with two fingers down. Elantech devices +may open slots without coordinate data. Alps devices may send 0/0 coordinates +as initial slot position. + +All these may be addressable with specific quirks, but the actual benefit is +largely restricted to better palm detection (though even with quirks this is +unlikely to work) and support for pinch gestures (again, lack of coordinates +makes supporting those hard anyway). + +Elantech: https://bugs.freedesktop.org/show_bug.cgi?id=93583 +Alps: https://bugzilla.redhat.com/show_bug.cgi?id=1295073 + +Signed-off-by: Peter Hutterer +--- + src/evdev-mt-touchpad-gestures.c | 6 ++---- + src/evdev-mt-touchpad.c | 21 +++++++++++++-------- + test/gestures.c | 2 +- + test/litest.h | 10 ---------- + test/touchpad-tap.c | 2 +- + 5 files changed, 17 insertions(+), 24 deletions(-) + +diff --git a/src/evdev-mt-touchpad-gestures.c b/src/evdev-mt-touchpad-gestures.c +index 80aa89f..24f6a6d 100644 +--- a/src/evdev-mt-touchpad-gestures.c ++++ b/src/evdev-mt-touchpad-gestures.c +@@ -568,10 +568,8 @@ tp_gesture_handle_state(struct tp_dispatch *tp, uint64_t time) + int + tp_init_gesture(struct tp_dispatch *tp) + { +- if (tp->device->model_flags & EVDEV_MODEL_JUMPING_SEMI_MT) +- tp->gesture.enabled = false; +- else +- tp->gesture.enabled = true; ++ /* semi-mt devices are too unreliable to do pinch gestures */ ++ tp->gesture.enabled = !tp->semi_mt; + + tp->gesture.twofinger_state = GESTURE_2FG_STATE_NONE; + +diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c +index 62087fb..7f5bbf5 100644 +--- a/src/evdev-mt-touchpad.c ++++ b/src/evdev-mt-touchpad.c +@@ -1490,17 +1490,22 @@ tp_init_slots(struct tp_dispatch *tp, + + tp->semi_mt = libevdev_has_property(device->evdev, INPUT_PROP_SEMI_MT); + +- /* This device has a terrible resolution when two fingers are down, ++ /* Semi-mt devices are not reliable for true multitouch data, so we ++ * simply pretend they're single touch touchpads with BTN_TOOL bits. ++ * Synaptics: ++ * Terrible resolution when two fingers are down, + * causing scroll jumps. The single-touch emulation ABS_X/Y is + * accurate but the ABS_MT_POSITION touchpoints report the bounding +- * box and that causes jumps. So we simply pretend it's a single +- * touch touchpad with the BTN_TOOL bits. +- * See https://bugzilla.redhat.com/show_bug.cgi?id=1235175 for an +- * explanation. ++ * box and that causes jumps. See https://bugzilla.redhat.com/1235175 ++ * Elantech: ++ * On three-finger taps/clicks, one slot doesn't get a coordinate ++ * assigned. See https://bugs.freedesktop.org/show_bug.cgi?id=93583 ++ * Alps: ++ * If three fingers are set down in the same frame, one slot has the ++ * coordinates 0/0 and may not get updated for several frames. ++ * See https://bugzilla.redhat.com/show_bug.cgi?id=1295073 + */ +- if (tp->semi_mt && +- (device->model_flags & +- (EVDEV_MODEL_JUMPING_SEMI_MT|EVDEV_MODEL_ELANTECH_TOUCHPAD))) { ++ if (tp->semi_mt) { + tp->num_slots = 1; + tp->slot = 0; + tp->has_mt = false; +diff --git a/test/gestures.c b/test/gestures.c +index 9fc73b9..0fc3964 100644 +--- a/test/gestures.c ++++ b/test/gestures.c +@@ -34,7 +34,7 @@ START_TEST(gestures_cap) + struct litest_device *dev = litest_current_device(); + struct libinput_device *device = dev->libinput_device; + +- if (litest_is_synaptics_semi_mt(dev)) ++ if (libevdev_has_property(dev->evdev, INPUT_PROP_SEMI_MT)) + ck_assert(!libinput_device_has_capability(device, + LIBINPUT_DEVICE_CAP_GESTURE)); + else +diff --git a/test/litest.h b/test/litest.h +index e74e923..61b1b01 100644 +--- a/test/litest.h ++++ b/test/litest.h +@@ -552,16 +552,6 @@ litest_enable_buttonareas(struct litest_device *dev) + litest_assert_int_eq(status, expected); + } + +-static inline int +-litest_is_synaptics_semi_mt(struct litest_device *dev) +-{ +- struct libevdev *evdev = dev->evdev; +- +- return libevdev_has_property(evdev, INPUT_PROP_SEMI_MT) && +- libevdev_get_id_vendor(evdev) == 0x2 && +- libevdev_get_id_product(evdev) == 0x7; +-} +- + static inline void + litest_enable_drag_lock(struct libinput_device *device) + { +diff --git a/test/touchpad-tap.c b/test/touchpad-tap.c +index 4450ec3..7a7e64c 100644 +--- a/test/touchpad-tap.c ++++ b/test/touchpad-tap.c +@@ -241,7 +241,7 @@ START_TEST(touchpad_1fg_multitap_n_drag_2fg) + int range = _i, + ntaps; + +- if (litest_is_synaptics_semi_mt(dev)) ++ if (libevdev_has_property(dev->evdev, INPUT_PROP_SEMI_MT)) + return; + + litest_enable_tap(dev->libinput_device); +-- +2.5.0 + diff --git a/0001-touchpad-disable-MT-for-elantech-semi-mt-touchpads.patch b/0001-touchpad-disable-MT-for-elantech-semi-mt-touchpads.patch new file mode 100644 index 0000000..5b73031 --- /dev/null +++ b/0001-touchpad-disable-MT-for-elantech-semi-mt-touchpads.patch @@ -0,0 +1,38 @@ +From 556aac04b5d56f015d5da8b96e24fd78ad231760 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Tue, 12 Jan 2016 12:24:18 +1000 +Subject: [PATCH libinput] touchpad: disable MT for elantech semi-mt touchpads + +When three fingers are set down on the touchpad, one finger tends to get a 0/0 +coordinate, triggering palm detection in the upper left corner. Handle this +like the jumping semi-mt touchpads and disable MT handling and instead +just rely on the x/y axis and the BTN_TOOL_* events. + +https://bugs.freedesktop.org/show_bug.cgi?id=93583 + +This kernel patch is required: +https://lkml.org/lkml/2016/1/11/171 + +Signed-off-by: Peter Hutterer +Reviewed-by: Hans de Goede +--- + src/evdev-mt-touchpad.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c +index 2de2539..f91f839 100644 +--- a/src/evdev-mt-touchpad.c ++++ b/src/evdev-mt-touchpad.c +@@ -1496,7 +1496,8 @@ tp_init_slots(struct tp_dispatch *tp, + * explanation. + */ + if (tp->semi_mt && +- (device->model_flags & EVDEV_MODEL_JUMPING_SEMI_MT)) { ++ (device->model_flags & ++ (EVDEV_MODEL_JUMPING_SEMI_MT|EVDEV_MODEL_ELANTECH_TOUCHPAD))) { + tp->num_slots = 1; + tp->slot = 0; + tp->has_mt = false; +-- +2.5.0 + diff --git a/libinput.spec b/libinput.spec index 0b9aba2..5b96bcf 100644 --- a/libinput.spec +++ b/libinput.spec @@ -5,7 +5,7 @@ Name: libinput Version: 1.1.4 -Release: 2%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} +Release: 3%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} Summary: Input device library License: MIT @@ -22,6 +22,8 @@ Source0: http://www.freedesktop.org/software/libinput/libinput-%{version} Patch01: 0001-touchpad-serial-synaptics-need-to-fake-new-touches-o.patch Patch02: 0001-touchpad-fix-DWT-pairing-for-Macbook-Pro-2015.patch +Patch03: 0001-touchpad-disable-MT-for-elantech-semi-mt-touchpads.patch +Patch04: 0001-touchpad-disable-MT-for-all-semi-mt-devices.patch BuildRequires: git BuildRequires: autoconf automake libtool pkgconfig @@ -99,6 +101,10 @@ find $RPM_BUILD_ROOT -name '*.la' -delete %changelog +* Tue Jan 19 2016 Peter Hutterer 1.1.4-3 +- disable MT for semi-mt devices to solve the various two- and three-finger + issues (at the cost of pinch gestures) (#1295073) + * Mon Jan 11 2016 Peter Hutterer 1.1.4-2 - fix disable-while-typing on macbooks