[PATCH libinput] touchpad: disable MT for all semi-mt devices

Hans de Goede hdegoede at redhat.com
Mon Jan 25 08:46:56 PST 2016


Hi,

On 25-01-16 04:03, Peter Hutterer wrote:
> On Fri, Jan 22, 2016 at 11:15:55AM +0100, Hans de Goede wrote:
>> Hi,
>>
>> On 22-01-16 03:06, Peter Hutterer wrote:
>>> On Wed, Jan 20, 2016 at 11:31:42AM +0100, Hans de Goede wrote:
>>>> Hi,
>>>>
>>
>> <snip>
>>
>>>> Then we can also revert:
>>>>
>>>> http://cgit.freedesktop.org/wayland/libinput/commit/?id=0d40aefe
>>>>
>>>> Making tp_gesture_get_active_touches() look only at real touches
>>>> again as intended.
>>>
>>>
>>> I don't think this is correct, we still need to count fake fingers on an ST
>>> touchpad for two-finger scrolling to trigger correctly.
>>
>> That is because you've put the:
>>
>> +	if (!tp->gesture.enabled)
>> +		return GESTURE_2FG_STATE_SCROLL;
>> +
>>
>> Check at the end of tp_gesture_twofinger_handle_state_none(), so after the
>> call to tp_gesture_get_active_touches().
>>
>> None of the variables set in tp_gesture_twofinger_handle_state_none() are
>> used when jumping straight to GESTURE_2FG_STATE_SCROLL, so you could do
>> the check at the beginning of tp_gesture_twofinger_handle_state_none()
>> (before calling tp_gesture_get_active_touches()), and then you no longer
>> need to worry about ST touchpads in there.
>
> Note: I've since merged the 3-finger pinch gesture branch, so merging this
> set on top caused a couple of conflicts and things look a bit different now.
>
> tp_gesture_twofinger_handle_state_none() was renamed and is now invoked for
> 3 and 4-finger states as well, so we do need a finger check to bail out.
> what I will add though is a direct jump to swipe for a >2 finger gesture on
> an ST touchpad, patch coming up.
>
>> The problem I've with checking all touches, not just real touches
>> in tp_gesture_get_active_touches() is that you may end up returning
>> a fake touch as one of the 2 touches, and then use the coordinates
>> of this fake touch to decide whether the user is doing a pinch or
>> a 2fg scroll. IMHO it would be better to just jump straight to 2FG
>> scrolling in this case (note currently we stay in GESTURE_2FG_STATE_NONE
>> if tp_gesture_get_active_touches() fails).
>
> the touchpad code is so that fake touches get the same
> positional coordinates as the first touch points. So you can't ever trigger
> a pinch on an ST device anyway, they'll always move in the same direction.
> I've tried to avoid putting more semi-mt conditions in than necessary,
> relying on that functionality to give us the correct coordinates.
>
> but I think the patch for the above addresses that anyway, so I think we're
> good here.

What has me worried is the case where we've a true multi-touch clickpad
which tracks 2 fingers, then the first finger down could be resting in
a soft-button area, and the user could be doing 2fg scrolling with his
other hand. In this case the coordinates of the resting finger will
be used for the 2nd touch of the 2fg scroll (the 3th finger down), so we
will be looking at the resting finger vs one of the 2 scrolling fingers which
makes things look like a pinch. Hence it is better to make
tp_gesture_get_active_touches only look at real touches, and if it fails
just play it safe and jump straight to scrolling / swiping.

Just my 2 cents on this :)

Regards,

Hans


More information about the wayland-devel mailing list