From 39be9449911a7d59386721944e1c4c45f620b95e Mon Sep 17 00:00:00 2001 From: Dorian Stoll Date: Tue, 3 Nov 2020 15:41:42 +0100 Subject: Lift canceled touch inputs If a touch input gets turned into a palm (by setting ABS_MT_TOOL_TYPE to MT_TOOL_PALM), libinput will emit a cancel event instead of the normal up event. The xorg wrapper needs to be able to handle a canceled touch and lift it, otherwise these inputs will never get lifted and will stick around forever. Signed-off-by: Dorian Stoll --- src/xf86libinput.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/xf86libinput.c b/src/xf86libinput.c index 2cb0d51..620af6d 100644 --- a/src/xf86libinput.c +++ b/src/xf86libinput.c @@ -1698,6 +1698,7 @@ xf86libinput_handle_touch(InputInfoPtr pInfo, touchids[slot] = next_touchid++; break; case LIBINPUT_EVENT_TOUCH_UP: + case LIBINPUT_EVENT_TOUCH_CANCEL: type = XI_TouchEnd; break; case LIBINPUT_EVENT_TOUCH_MOTION: @@ -1709,7 +1710,7 @@ xf86libinput_handle_touch(InputInfoPtr pInfo, valuator_mask_zero(m); - if (event_type != LIBINPUT_EVENT_TOUCH_UP) { + if (type != XI_TouchEnd) { val = libinput_event_touch_get_x_transformed(event, TOUCH_AXIS_MAX); valuator_mask_set_double(m, 0, val); -- cgit v1.2.3