From b8611394cda21bf002c38379e01d62d61d9be04a Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Fri, 7 Mar 2014 10:34:46 +1000 Subject: 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 Signed-off-by: Peter Hutterer --- src/libinput.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/libinput.c b/src/libinput.c index cea83c1..fb19de9 100644 --- a/src/libinput.c +++ b/src/libinput.c @@ -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); } -- cgit v1.2.3