diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2016-01-29 16:25:31 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2016-02-04 15:12:55 +1000 |
commit | f6c2d4b8b5e1968411568d81b47488a655ba47a1 (patch) | |
tree | f520717f3cfcf1ba6dfe98a088d50708a9831a8f | |
parent | c352a50295c5b63176cd9d4957ce82d4f2aa363f (diff) |
touchpad: drop motion hysteresis by default
Some older touchpad devices jitter a fair bit when a finger is resting on the
touchpad. That's why the hysteresis was introduced in the synaptics driver
back in 2011. However, the default value of the hysteresis in the synaptics
driver ended up being 0, even though the code looks like it's using a fraction
of the touchpad diagonal. When the hysteresis code was ported to libinput it
was eventually set to 0.5mm.
Turns out this is still too high and tiny finger motions are either
nonreactive or quite jumpy, making it hard to select small targets. Drop the
default hysteresis by reducing its margin to 0, but leave it in place for
those devices where we need them (e.g. the cyapa touchpads).
https://bugs.freedesktop.org/show_bug.cgi?id=93503
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r-- | src/evdev-mt-touchpad.c | 23 | ||||
-rw-r--r-- | src/evdev.c | 1 | ||||
-rw-r--r-- | src/evdev.h | 1 | ||||
-rw-r--r-- | udev/90-libinput-model-quirks.hwdb | 3 |
4 files changed, 23 insertions, 5 deletions
diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c index f249116..0f72807 100644 --- a/src/evdev-mt-touchpad.c +++ b/src/evdev-mt-touchpad.c @@ -1951,13 +1951,29 @@ tp_init_default_resolution(struct tp_dispatch *tp, return 0; } +static inline void +tp_init_hysteresis(struct tp_dispatch *tp) +{ + int res_x, res_y; + + res_x = tp->device->abs.absinfo_x->resolution; + res_y = tp->device->abs.absinfo_y->resolution; + + if (tp->device->model_flags & EVDEV_MODEL_CYAPA) { + tp->hysteresis_margin.x = res_x/2; + tp->hysteresis_margin.y = res_y/2; + } else { + tp->hysteresis_margin.x = 0; + tp->hysteresis_margin.y = 0; + } +} + static int tp_init(struct tp_dispatch *tp, struct evdev_device *device) { int width, height; double diagonal; - int res_x, res_y; tp->base.interface = &tp_interface; tp->device = device; @@ -1971,8 +1987,6 @@ tp_init(struct tp_dispatch *tp, if (tp_init_slots(tp, device) != 0) return -1; - res_x = tp->device->abs.absinfo_x->resolution; - res_y = tp->device->abs.absinfo_y->resolution; width = device->abs.dimensions.x; height = device->abs.dimensions.y; diagonal = sqrt(width*width + height*height); @@ -1981,8 +1995,7 @@ tp_init(struct tp_dispatch *tp, EV_ABS, ABS_MT_DISTANCE); - tp->hysteresis_margin.x = res_x/2; - tp->hysteresis_margin.y = res_y/2; + tp_init_hysteresis(tp); if (tp_init_accel(tp, diagonal) != 0) return -1; diff --git a/src/evdev.c b/src/evdev.c index 66673a8..473ff63 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -1678,6 +1678,7 @@ evdev_read_model_flags(struct evdev_device *device) { "LIBINPUT_MODEL_ELANTECH_TOUCHPAD", EVDEV_MODEL_ELANTECH_TOUCHPAD }, { "LIBINPUT_MODEL_APPLE_INTERNAL_KEYBOARD", EVDEV_MODEL_APPLE_INTERNAL_KEYBOARD }, { "LIBINPUT_MODEL_CYBORG_RAT", EVDEV_MODEL_CYBORG_RAT }, + { "LIBINPUT_MODEL_CYAPA", EVDEV_MODEL_CYAPA }, { NULL, EVDEV_MODEL_DEFAULT }, }; const struct model_map *m = model_map; diff --git a/src/evdev.h b/src/evdev.h index 8b567a8..b164af8 100644 --- a/src/evdev.h +++ b/src/evdev.h @@ -111,6 +111,7 @@ enum evdev_device_model { EVDEV_MODEL_LENOVO_X220_TOUCHPAD_FW81 = (1 << 12), EVDEV_MODEL_APPLE_INTERNAL_KEYBOARD = (1 << 13), EVDEV_MODEL_CYBORG_RAT = (1 << 14), + EVDEV_MODEL_CYAPA = (1 << 15), }; struct mt_slot { diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb index fa668d6..f23a7f9 100644 --- a/udev/90-libinput-model-quirks.hwdb +++ b/udev/90-libinput-model-quirks.hwdb @@ -73,6 +73,9 @@ libinput:name:Cypress APA Trackpad (cyapa):dmi:*svn*SAMSUNG*:pn*Lumpy* libinput:name:Atmel maXTouch Touchpad:dmi:*svn*GOOGLE*:pn*Samus* LIBINPUT_MODEL_CHROMEBOOK=1 +libinput:name:Cypress APA Trackpad (cyapa):dmi:* + LIBINPUT_MODEL_CYAPA=1 + ########################################## # LENOVO ########################################## |