diff options
author | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2014-03-07 10:34:46 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2014-03-07 10:35:13 +1000 |
commit | b8611394cda21bf002c38379e01d62d61d9be04a (patch) | |
tree | 0fe8742dcf66c735e2262be536e45b9605599f10 /src | |
parent | 74cd082e15e939648f552d24bec3fdd586d8e1c5 (diff) |
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 <benjamin.tissoires@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/libinput.c | 10 |
1 files changed, 6 insertions, 4 deletions
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); } |