summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Expósito <jose.exposito89@gmail.com>2021-09-24 19:06:53 +0200
committerJosé Expósito <jose.exposito89@gmail.com>2021-09-24 19:06:53 +0200
commitf0d3761f737211f64ec117ce963d402603a739a3 (patch)
tree1df515cce3b06961609e6f7f1b0f179c31c9dbcb
parentceda09e87b1fedfad0a3c5e8a992cb2127e03427 (diff)
downloadlibinput-f0d3761f737211f64ec117ce963d402603a739a3.tar.gz
libinput: add hold to get base event
LIBINPUT_EVENT_GESTURE_HOLD_BEGIN and LIBINPUT_EVENT_GESTURE_HOLD_END were missing from libinput_event_gesture_get_base_event. Add them to avoid triggering an erroneous client bug warning. Fix #671 Signed-off-by: José Expósito <jose.exposito89@gmail.com>
-rw-r--r--src/libinput.c4
-rw-r--r--test/test-misc.c5
2 files changed, 7 insertions, 2 deletions
diff --git a/src/libinput.c b/src/libinput.c
index a0c85043..f985b79f 100644
--- a/src/libinput.c
+++ b/src/libinput.c
@@ -3567,7 +3567,9 @@ libinput_event_gesture_get_base_event(struct libinput_event_gesture *event)
LIBINPUT_EVENT_GESTURE_SWIPE_END,
LIBINPUT_EVENT_GESTURE_PINCH_BEGIN,
LIBINPUT_EVENT_GESTURE_PINCH_UPDATE,
- LIBINPUT_EVENT_GESTURE_PINCH_END);
+ LIBINPUT_EVENT_GESTURE_PINCH_END,
+ LIBINPUT_EVENT_GESTURE_HOLD_BEGIN,
+ LIBINPUT_EVENT_GESTURE_HOLD_END);
return &event->base;
}
diff --git a/test/test-misc.c b/test/test-misc.c
index 398faa2e..732cb12e 100644
--- a/test/test-misc.c
+++ b/test/test-misc.c
@@ -366,6 +366,9 @@ START_TEST(event_conversion_gesture)
litest_touch_down(dev, 0, 70, 30);
litest_touch_down(dev, 1, 30, 70);
+ libinput_dispatch(li);
+ litest_timeout_gesture_hold();
+
for (i = 0; i < 8; i++) {
litest_push_event_frame(dev);
litest_touch_move(dev, 0, 70 - i * 5, 30 + i * 5);
@@ -379,7 +382,7 @@ START_TEST(event_conversion_gesture)
type = libinput_event_get_type(event);
if (type >= LIBINPUT_EVENT_GESTURE_SWIPE_BEGIN &&
- type <= LIBINPUT_EVENT_GESTURE_PINCH_END) {
+ type <= LIBINPUT_EVENT_GESTURE_HOLD_END) {
struct libinput_event_gesture *g;
struct libinput_event *base;
g = libinput_event_get_gesture_event(event);