[PATCH libinput] touchpad: fix tapping that happens after a moving thumb

Peter Hutterer peter.hutterer at who-t.net
Wed May 9 04:34:31 UTC 2018


On Sat, May 05, 2018 at 03:49:32AM +0200, Friedrich Schöller wrote:
> When finger movement exceeded the motion threshold before the finger was
> recognized as a thumb, it would never be regarded as a thumb by the tap system.
> This prohibited tapping until the thumb was lifted.
> 
> This is fixed by moving the check for the thumb state up such that it
> happens before the motion threshold check.

thanks, patch looks good and is merged locally. Any chance I can convince
you to write a test case for this? :)
Would make sure that we're not breaking this again.

Cheers,
   Peter

> ---
>  src/evdev-mt-touchpad-tap.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/src/evdev-mt-touchpad-tap.c b/src/evdev-mt-touchpad-tap.c
> index 5946dc8f..e3e051ca 100644
> --- a/src/evdev-mt-touchpad-tap.c
> +++ b/src/evdev-mt-touchpad-tap.c
> @@ -1039,6 +1039,9 @@ tp_tap_handle_state(struct tp_dispatch *tp, uint64_t time)
>  				tp_tap_handle_event(tp, t, TAP_EVENT_RELEASE, time);
>  			}
>  			t->tap.state = TAP_TOUCH_STATE_IDLE;
> +		} else if (tp->tap.state != TAP_STATE_IDLE &&
> +			   t->thumb.state == THUMB_STATE_YES) {
> +			tp_tap_handle_event(tp, t, TAP_EVENT_THUMB, time);
>  		} else if (tp->tap.state != TAP_STATE_IDLE &&
>  			   tp_tap_exceeds_motion_threshold(tp, t)) {
>  			struct tp_touch *tmp;
> @@ -1051,10 +1054,6 @@ tp_tap_handle_state(struct tp_dispatch *tp, uint64_t time)
>  			}
>  
>  			tp_tap_handle_event(tp, t, TAP_EVENT_MOTION, time);
> -		} else if (tp->tap.state != TAP_STATE_IDLE &&
> -			   t->thumb.state == THUMB_STATE_YES &&
> -			   !t->tap.is_thumb) {
> -			tp_tap_handle_event(tp, t, TAP_EVENT_THUMB, time);
>  		}
>  	}
>  
> -- 
> 2.14.3
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/wayland-devel
> 


More information about the wayland-devel mailing list