Commit e961c1ff authored by Peter Hutterer's avatar Peter Hutterer

debounce: handle a timeout in MAYBE_SPURIOUS state

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: default avatarVicente Bergas <vicencb@gmail.com>
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit ac1748ef)
parent c77b6b4c
This diff is collapsed.
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment