summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2016-08-22 16:06:59 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2016-08-23 07:07:55 +1000
commitb1a811ee521dc56ed5d1c789251fad245b758a80 (patch)
treebd2476e915ad6f8c7677191ef1e4d9f9c1ac6491
parentb02acd346bbfac2d95f71a2399219c93ebed0ad7 (diff)
touchpad: reset the edge scroll state on touch up if edge scroll is disabled
If a touch was down (and up again) before the device was switched to edge scrolling, libinput reported an error message: litest error: libinput bug: unexpected scroll event 0 in area state While edge scrolling was disabled, any new touch would be set to the area state but it was never reset on touch release. https://bugs.freedesktop.org/show_bug.cgi?id=97425 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r--src/evdev-mt-touchpad-edge-scroll.c3
-rw-r--r--test/touchpad.c8
2 files changed, 11 insertions, 0 deletions
diff --git a/src/evdev-mt-touchpad-edge-scroll.c b/src/evdev-mt-touchpad-edge-scroll.c
index 081d2c4..1d30bca 100644
--- a/src/evdev-mt-touchpad-edge-scroll.c
+++ b/src/evdev-mt-touchpad-edge-scroll.c
@@ -338,6 +338,9 @@ tp_edge_scroll_handle_state(struct tp_dispatch *tp, uint64_t time)
if (t->state == TOUCH_BEGIN)
t->scroll.edge_state =
EDGE_SCROLL_TOUCH_STATE_AREA;
+ else if (t->state == TOUCH_END)
+ t->scroll.edge_state =
+ EDGE_SCROLL_TOUCH_STATE_NONE;
}
return;
}
diff --git a/test/touchpad.c b/test/touchpad.c
index 06bde13..ea20036 100644
--- a/test/touchpad.c
+++ b/test/touchpad.c
@@ -429,6 +429,10 @@ START_TEST(touchpad_edge_scroll_vert)
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
+ litest_touch_down(dev, 0, 99, 20);
+ litest_touch_move_to(dev, 0, 99, 20, 99, 80, 10, 0);
+ litest_touch_up(dev, 0);
+
litest_drain_events(li);
litest_enable_edge_scroll(dev);
@@ -466,6 +470,10 @@ START_TEST(touchpad_edge_scroll_horiz)
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
+ litest_touch_down(dev, 0, 99, 20);
+ litest_touch_move_to(dev, 0, 99, 20, 99, 80, 10, 0);
+ litest_touch_up(dev, 0);
+
if (!touchpad_has_horiz_edge_scroll_size(dev))
return;