From 19446a029bd17c3aa6665bf695ed1b3a9bcdb60e Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 13 Nov 2023 20:05:13 +1000 Subject: [PATCH] fallback: add messages for touch arbitration debugging --- src/evdev-fallback.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/evdev-fallback.c b/src/evdev-fallback.c index db8f4e59..a9711874 100644 --- a/src/evdev-fallback.c +++ b/src/evdev-fallback.c @@ -968,9 +968,17 @@ fallback_interface_process(struct evdev_dispatch *evdev_dispatch, uint64_t time) { struct fallback_dispatch *dispatch = fallback_dispatch(evdev_dispatch); + static bool warned = false; - if (dispatch->arbitration.in_arbitration) + if (dispatch->arbitration.in_arbitration) { + if (!warned) { + evdev_log_debug(device, "dropping events due to touch arbitration\n"); + warned = true; + } return; + } + + warned = false; switch (event->type) { case EV_REL: @@ -1188,6 +1196,7 @@ fallback_interface_toggle_touch(struct evdev_dispatch *evdev_dispatch, { struct fallback_dispatch *dispatch = fallback_dispatch(evdev_dispatch); struct device_coord_rect rect = {0}; + const char *state = NULL; if (which == dispatch->arbitration.state) return; @@ -1203,20 +1212,25 @@ fallback_interface_toggle_touch(struct evdev_dispatch *evdev_dispatch, * event is caught as palm touch. */ libinput_timer_set(&dispatch->arbitration.arbitration_timer, time + ms2us(90)); + state = "not-active"; break; case ARBITRATION_IGNORE_RECT: assert(phys_rect); rect = evdev_phys_rect_to_units(device, phys_rect); cancel_touches(dispatch, device, &rect, time); dispatch->arbitration.rect = rect; + state = "ignore-rect"; break; case ARBITRATION_IGNORE_ALL: libinput_timer_cancel(&dispatch->arbitration.arbitration_timer); fallback_return_to_neutral_state(dispatch, device); dispatch->arbitration.in_arbitration = true; + state = "ignore-all"; break; } + evdev_log_debug(device, "Touch arbitration state now %s\n", state); + dispatch->arbitration.state = which; } @@ -1621,6 +1635,8 @@ fallback_arbitration_timeout(uint64_t now, void *data) if (dispatch->arbitration.in_arbitration) dispatch->arbitration.in_arbitration = false; + + evdev_log_debug(dispatch->device, "touch arbitration timeout\n"); } static void