[PATCH libinput] touchpad: disable MT for elantech semi-mt touchpads
Hans de Goede
hdegoede at redhat.com
Wed Jan 13 01:17:58 PST 2016
Hi,
On 13-01-16 05:09, Peter Hutterer wrote:
> 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 <peter.hutterer at who-t.net>
Patch looks good to me:
Reviewed-by: Hans de Goede <hdegoede at redhat.com>
About Benjamin's patch:
https://lkml.org/lkml/2016/1/11/171
Benjamin, when you pass in INPUT_MT_SEMI_MT, you can drop the:
__set_bit(INPUT_PROP_SEMI_MT, dev->propbit);
A few lines up, since input_mt_init_slots will do that now.
More in general the elantech driver could do with some cleanup
to fully use the input_mt helpers, specifically stop doing
pointer emulation itself for v2 and v3 touchpads:
- pass in INPUT_MT_POINTER to input_mt_init_slots and stop initializing
ABS_X / ABS_Y and move input_mt_init_slots to after setting up the MT
axis (this applies to v4 too)
- Stop reporting BTN_TOUCH / ABS_X / ABSY in diy style instead just call
input_mt_frame_sync before input_sync
- Replace:
input_report_key(dev, BTN_TOOL_FINGER, fingers == 1);
input_report_key(dev, BTN_TOOL_DOUBLETAP, fingers == 2);
input_report_key(dev, BTN_TOOL_TRIPLETAP, fingers == 3);
input_report_key(dev, BTN_TOOL_QUADTAP, fingers == 4);
With:
input_mt_report_finger_count(dev, fingers);
- And for v4 touchpads replace:
input_mt_report_pointer_emulation(dev, true);
With:
input_mt_frame_sync(dev);
Which ends up doing the same, but is the right way to use the
input_mt helpers
Regards,
Hans
> ---
> 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;
>
More information about the wayland-devel
mailing list