diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2015-07-30 11:54:38 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2015-08-03 11:40:29 +1000 |
commit | 7013a20f8b6a441a5f80b84aa261c32dd8011f95 (patch) | |
tree | 4582b04fc704874d9a4f9ff12446768c7de003b1 /src | |
parent | 6933062dab0fa65d131e44bab2f7ace3563d9731 (diff) |
touchpad: pretend the jumpy semi-mt touchpad is a single-touch touchpad
The first finger is accurate, it's just the second finger that is imprecise,
so we can't handle it as a true touch. Instead, revert the device back to
being a single-touch touchpad and use the fake touch bits for second finger
handling.
Two-finger scrolling thus becomes usable though we will lose out on
other features like thumb detection. Useful scrolling trumps that though.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/evdev-mt-touchpad.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c index af1cd47..64ec446 100644 --- a/src/evdev-mt-touchpad.c +++ b/src/evdev-mt-touchpad.c @@ -1465,6 +1465,21 @@ 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, + * 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. + */ + if (tp->semi_mt && + (device->model_flags & EVDEV_MODEL_JUMPING_SEMI_MT)) { + tp->num_slots = 1; + tp->slot = 0; + tp->has_mt = false; + } + ARRAY_FOR_EACH(max_touches, m) { if (libevdev_has_event_code(device->evdev, EV_KEY, @@ -1526,11 +1541,7 @@ tp_scroll_get_methods(struct tp_dispatch *tp) { uint32_t methods = LIBINPUT_CONFIG_SCROLL_EDGE; - /* some Synaptics semi-mt touchpads have a terrible 2fg resolution, - * causing scroll jumps. For all other 2fg touchpads, we enable 2fg - * scrolling */ - if (tp->ntouches >= 2 && - (tp->device->model_flags & EVDEV_MODEL_JUMPING_SEMI_MT) == 0) + if (tp->ntouches >= 2) methods |= LIBINPUT_CONFIG_SCROLL_2FG; return methods; |