Commit b8611394 authored by Benjamin Tissoires's avatar Benjamin Tissoires Committed by Peter Hutterer

Do not set valuators for touch up events

the kernel does not send any ABS_MT_POSITION_X|Y data while releasing
the touch, so use the previous values to set the position of the release.

If it's not done, the touch up occurs at (0,0) and moves dragged elements
to the upper right corner.
Signed-off-by: Benjamin Tissoires's avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent 74cd082e
......@@ -436,11 +436,13 @@ xf86libinput_handle_touch(InputInfoPtr pInfo,
m = valuator_mask_new(2);
val = libinput_event_touch_get_x_transformed(event, TOUCH_AXIS_MAX);
valuator_mask_set_double(m, 0, li_fixed_to_double(val));
if (event_type != LIBINPUT_EVENT_TOUCH_UP) {
val = libinput_event_touch_get_x_transformed(event, TOUCH_AXIS_MAX);
valuator_mask_set_double(m, 0, li_fixed_to_double(val));
val = libinput_event_touch_get_y_transformed(event, TOUCH_AXIS_MAX);
valuator_mask_set_double(m, 1, li_fixed_to_double(val));
val = libinput_event_touch_get_y_transformed(event, TOUCH_AXIS_MAX);
valuator_mask_set_double(m, 1, li_fixed_to_double(val));
}
xf86PostTouchEvent(dev, touchids[slot], type, 0, m);
}
......
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