[PATCH libinput 4/6] touchpad: disable gestures on Synaptics semi-mt touchpads

Peter Hutterer peter.hutterer at who-t.net
Thu Jul 30 16:51:32 PDT 2015


On Thu, Jul 30, 2015 at 04:34:14PM +0200, Hans de Goede wrote:
> Hi,
> 
> On 30-07-15 14:31, Hans de Goede wrote:
> >Hi,
> >
> >On 30-07-15 08:11, Peter Hutterer wrote:
> >>Follow-up to eb146677e, if we disable 2fg scrolling on those touchpads we
> >>should also disable gestures. The data doesn't magically become more useful.
> >
> >I think we should wait with doing this until the scroll situation is more
> >clear, see my last comment here:
> >
> >https://bugzilla.redhat.com/show_bug.cgi?id=1235175
> 
> Ok, so Benjamin has just explained what is going on here, these touchpads
> report accurate single touch data in the old-style single-touch
> events, and inaccurate data in the mt events when 2 fingers are down.
> 
> This means that we should disable pinch gestures, but your other
> patch which switches to the single touch events already effectively
> does that, as both touches (the real one and a fake one) will be
> moving in the same direction, so this will never be seen as a pinch.
> 
> 3 fg swipes (assuming the touchpad can report 3 fingers down) will
> however work fine, since they will be reporting the movement from
> the accurate single touch events, so I see no reason to disable
> gestures, we should switch to a 2mm threshold for pinch / zoom
> detection on these though, or better make the 4mm threshold
> an alps only thing.

hmm, I'm somewhat hesitant to claim that the device supports gestures when
we know we can't do one of the two gestures we support. I think it's better
to just say that we don't do gestures on this device. Which would allow the
UI to adjust accordingly.

especially since this is just a single device at this point, and not a new
or common one (afaict) at that.

Cheers,
   Peter

> >>
> >>Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> >>---
> >>  src/evdev-mt-touchpad-gestures.c | 6 +++++-
> >>  test/gestures.c                  | 8 ++++++--
> >>  2 files changed, 11 insertions(+), 3 deletions(-)
> >>
> >>diff --git a/src/evdev-mt-touchpad-gestures.c b/src/evdev-mt-touchpad-gestures.c
> >>index da03c26..1482136 100644
> >>--- a/src/evdev-mt-touchpad-gestures.c
> >>+++ b/src/evdev-mt-touchpad-gestures.c
> >>@@ -565,7 +565,11 @@ tp_gesture_handle_state(struct tp_dispatch *tp, uint64_t time)
> >>  int
> >>  tp_init_gesture(struct tp_dispatch *tp)
> >>  {
> >>-    tp->gesture.enabled = true;
> >>+    if (tp->device->model_flags & EVDEV_MODEL_JUMPING_SEMI_MT)
> >>+        tp->gesture.enabled = false;
> >>+    else
> >>+        tp->gesture.enabled = true;
> >>+
> >>      tp->gesture.twofinger_state = GESTURE_2FG_STATE_NONE;
> >>
> >>      libinput_timer_init(&tp->gesture.finger_count_switch_timer,
> >>diff --git a/test/gestures.c b/test/gestures.c
> >>index 3b7ba7b..9e44724 100644
> >>--- a/test/gestures.c
> >>+++ b/test/gestures.c
> >>@@ -34,8 +34,12 @@ START_TEST(gestures_cap)
> >>      struct litest_device *dev = litest_current_device();
> >>      struct libinput_device *device = dev->libinput_device;
> >>
> >>-    ck_assert(libinput_device_has_capability(device,
> >>-                         LIBINPUT_DEVICE_CAP_GESTURE));
> >>+    if (litest_is_synaptics_semi_mt(dev))
> >>+        ck_assert(!libinput_device_has_capability(device,
> >>+                      LIBINPUT_DEVICE_CAP_GESTURE));
> >>+    else
> >>+        ck_assert(libinput_device_has_capability(device,
> >>+                     LIBINPUT_DEVICE_CAP_GESTURE));
> >>  }
> >>  END_TEST
> >>
> >>


More information about the wayland-devel mailing list