[PATCH libinput] debounce: handle a timeout in MAYBE_SPURIOUS state

Vicente Bergas vicencb at gmail.com
Tue Nov 28 20:13:29 UTC 2017


On Tuesday, November 21, 2017 8:10:19 AM CET, Peter Hutterer wrote:
> Sequences to trigger:
> - spurious debouncing is enabled
> - release a button in IS_DOWN state -> RELEASE_DELAYED
> - short timeout triggers RELEASE_WAITING
>
> If a button press now comes before the long timeout expires, we 
> transition to
> MAYBE_SPURIOUS where the long timeout may expire. In that case we should
> transition to pressed state again.
>
> Reported-by: Vicente Bergas <vicencb at gmail.com>
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> ---
>  doc/button-debouncing-state-machine.svg | 369 
> +++++++++++---------------------
>  src/evdev-debounce.c                    |   4 +-
>  2 files changed, 121 insertions(+), 252 deletions(-)
>
> diff --git a/doc/button-debouncing-state-machine.svg 
> b/doc/button-debouncing-state-machine.svg
> index 6f106a89..48723a13 100644
> --- a/doc/button-debouncing-state-machine.svg
> +++ b/doc/button-debouncing-state-machine.svg
> ...
> diff --git a/src/evdev-debounce.c b/src/evdev-debounce.c
> index 7f96249b..74faf39b 100644
> --- a/src/evdev-debounce.c
> +++ b/src/evdev-debounce.c
> @@ -335,9 +335,6 @@ debounce_maybe_spurious_handle_event(struct 
> fallback_dispatch *fallback, enum de
>  	case DEBOUNCE_EVENT_RELEASE:
>  		debounce_set_state(fallback, DEBOUNCE_STATE_RELEASE_WAITING);
>  		break;
> -	case DEBOUNCE_EVENT_TIMEOUT:
> -		log_debounce_bug(fallback, event);
> -		break;
>  	case DEBOUNCE_EVENT_TIMEOUT_SHORT:
>  		debounce_cancel_timer(fallback);
>  		debounce_set_state(fallback, DEBOUNCE_STATE_IS_DOWN);
> @@ -345,6 +342,7 @@ debounce_maybe_spurious_handle_event(struct 
> fallback_dispatch *fallback, enum de
>  		debounce_notify_button(fallback,
>  				       LIBINPUT_BUTTON_STATE_PRESSED);
>  		break;
> +	case DEBOUNCE_EVENT_TIMEOUT:
>  	case DEBOUNCE_EVENT_OTHERBUTTON:
>  		debounce_set_state(fallback, DEBOUNCE_STATE_IS_DOWN);
>  		debounce_notify_button(fallback,
Hi Peter,

So far it has been one whole week testing ba9e6012a52b plus your 74faf39b 
patch.
No issues to report.
Good work!

Regards,
  Vicente.


More information about the wayland-devel mailing list