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 <dorian.stoll@tmsp.io>
This commit is contained in:
Dorian Stoll
2020-11-03 15:41:42 +01:00
parent bd2aaa246d
commit 39be944991

View File

@@ -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);