[RFC libinput] Add an API for touchpad gesture events

Hans de Goede hdegoede at redhat.com
Wed Jan 28 06:51:43 PST 2015


Hi,

On 28-01-15 13:59, Carlos Garnacho wrote:
> Hey Hans!,
>
> (sorry for chiming in late, things got busy around Fosdem...)
>
> On jue, 2015-01-22 at 16:52 +0100, Hans de Goede wrote:
>> +	LIBINPUT_EVENT_GESTURE_SWIPE_START = 600,
>> +	LIBINPUT_EVENT_GESTURE_SWIPE,
>> +	LIBINPUT_EVENT_GESTURE_SWIPE_END,
>>   };
>>
>
> One thing I'm unsure about this approach. Is there any plan to support
> continuation and chaining-up of gestures?
>
> Eg. what would happen if a 3fg gesture is started and the user rests a
> 4th finger on the touchpad? would you get SWIPE_END for 3fg and
> SWIPE_START for 4fg?

If we detect that the finger is just resting, e.g. we think it is a palm,
then the 3fg gesture continues. If we believe it is an active finger
then yes you would get a SWIPE_END for 3fg and SWIPE_START for 4fg,
note that the implementation will ignore short (in duration) changes,
so e.g. a quick accidental brush with an extra finger, or shortly
lifting one finger will be seen as the gesture continuing as normal.

> How would the compositor know whether the gesture
> finished in a non misleading way?

By the LIBINPUT_EVENT_GESTURE_SWIPE_END, if we send that too soon, then
that would be a libinput implementation bug.

> What I would expect it to happen is that the compositor cancelled the
> reaction to the 3fg swipe in this situation.

Right.

> If OTOH gestures aren't continued, it would seem to me like confusing
> behavior, esp if this already happens between 1fg and 2fg (moving the
> pointer and then scrolling, although not back)

The plan is to use the same code for all "mode" switches, so you will
be able to go back from 2fg scrolling to controlling the pointer by
lifting only a single finger (and then waiting for the accidental
change timeout, likely 200ms or so. Note that Peter has already fixed
this particular case independent of the gesture stuff.

Basically any case were the number of active (not seen as palm and
not seen as a finger resting in a button area on a clickpad) fingers
changes, and stays at the new value for > timeout ms we will end the
current mode and switch to the new mode, which may mean switching
from pointer control to scrolling or back, or from pointer control or
scrolling to a X-fg swipe. Basically pointer control and scrolling will
be seen as 1fg / 2fg gestures.

Later will add code to differentiate between scroll vs zoom/rotate mode
when in 2fg mode.

Regards,

Hans



More information about the wayland-devel mailing list