summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDorian Stoll <dorian.stoll@tmsp.io>2020-11-03 15:41:42 +0100
committerDorian Stoll <dorian.stoll@tmsp.io>2020-11-04 23:53:01 +0100
commit39be9449911a7d59386721944e1c4c45f620b95e (patch)
treee4020f1bf515845e04fb3a4bf96d39117a42acfb
parentbd2aaa246dae9ed1896d48ee4a5594c41107d123 (diff)
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>
-rw-r--r--src/xf86libinput.c3
1 files changed, 2 insertions, 1 deletions
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);