touchpad: elantech touchpads can use a 2mm gesture motion threshold
authorPeter Hutterer <peter.hutterer@who-t.net>
Thu, 30 Jul 2015 01:46:13 +0000 (11:46 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Mon, 3 Aug 2015 01:40:29 +0000 (11:40 +1000)
Unlike ALPS and Synaptics semi-mt touchpads, the Elantech touchpads appear to
be precise enough to allow a smaller motion threshold before we decide on the
type of gesture (pinch vs scroll).

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
src/evdev-mt-touchpad-gestures.c
src/evdev.c
src/evdev.h
udev/90-libinput-model-quirks.hwdb

index 1482136..6017416 100644 (file)
@@ -189,8 +189,10 @@ tp_gesture_get_direction(struct tp_dispatch *tp, struct tp_touch *touch)
        /*
         * Semi-mt touchpads have somewhat inaccurate coordinates when
         * 2 fingers are down, so use a slightly larger threshold.
+        * Elantech semi-mt touchpads are accurate enough though.
         */
-       if (tp->semi_mt)
+       if (tp->semi_mt &&
+           (tp->device->model_flags & EVDEV_MODEL_ELANTECH_TOUCHPAD) == 0)
                move_threshold = TP_MM_TO_DPI_NORMALIZED(4);
        else
                move_threshold = TP_MM_TO_DPI_NORMALIZED(2);
index aba124b..17c2604 100644 (file)
@@ -1543,6 +1543,7 @@ evdev_read_model_flags(struct evdev_device *device)
                { "LIBINPUT_MODEL_ALPS_TOUCHPAD", EVDEV_MODEL_ALPS_TOUCHPAD },
                { "LIBINPUT_MODEL_SYNAPTICS_SERIAL_TOUCHPAD", EVDEV_MODEL_SYNAPTICS_SERIAL_TOUCHPAD },
                { "LIBINPUT_MODEL_JUMPING_SEMI_MT", EVDEV_MODEL_JUMPING_SEMI_MT },
+               { "LIBINPUT_MODEL_ELANTECH_TOUCHPAD", EVDEV_MODEL_ELANTECH_TOUCHPAD },
                { NULL, EVDEV_MODEL_DEFAULT },
        };
        const struct model_map *m = model_map;
index c7017ba..be5df0d 100644 (file)
@@ -106,6 +106,7 @@ enum evdev_device_model {
        EVDEV_MODEL_ALPS_TOUCHPAD = (1 << 8),
        EVDEV_MODEL_SYNAPTICS_SERIAL_TOUCHPAD = (1 << 9),
        EVDEV_MODEL_JUMPING_SEMI_MT = (1 << 10),
+       EVDEV_MODEL_ELANTECH_TOUCHPAD = (1 << 11),
 };
 
 struct mt_slot {
index a34b8f1..cf4fbfa 100644 (file)
@@ -39,6 +39,7 @@ libinput:touchpad:input:b0005v05ACp*
 ##########################################
 libinput:name:*ETPS/2 Elantech Touchpad*:dmi:*
  LIBINPUT_ATTR_RESOLUTION_HINT=31x31
+ LIBINPUT_MODEL_ELANTECH_TOUCHPAD=1
 
 ##########################################
 # Google