diff options
author | Povilas Kanapickas <povilas@radix.lt> | 2020-12-20 02:40:55 +0200 |
---|---|---|
committer | Povilas Kanapickas <povilas@radix.lt> | 2021-01-06 01:47:05 +0000 |
commit | 687d4517261ac1bd5c10da40e632cac391ed3fd8 (patch) | |
tree | 85eb7d52142f321aad411a98ee88396f475fc3ef | |
parent | e36311a6f2af1346e4cad09dcbdf3a88b71adc4b (diff) |
grab: Expect motion events before touch-emulated button presses
The current server code for event is clear in that emulated motion
events are expected before emulated button events. Update tests to
match.
Note that in the case of pointer grabs, the first motion event is not
reported because by that time the press event has not happened yet and
the pointer grab is not yet active.
-rw-r--r-- | tests/server/grab.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/server/grab.cpp b/tests/server/grab.cpp index a7525f4..eaf603c 100644 --- a/tests/server/grab.cpp +++ b/tests/server/grab.cpp @@ -1500,13 +1500,16 @@ TEST_P(TouchUngrabTest, UngrabButtonDuringTouch) switch (grab_type) { case GRABTYPE_CORE: { - ASSERT_EVENT(XEvent, release, dpy, ButtonRelease); + ASSERT_EVENT(XEvent, release, dpy, MotionNotify); + ASSERT_EVENT(XEvent, motion, dpy, ButtonRelease); break; } case GRABTYPE_XI1: break; case GRABTYPE_XI2: { + ASSERT_EVENT(XIDeviceEvent, motion, dpy, GenericEvent, + xi2_opcode, XI_Motion); ASSERT_EVENT(XIDeviceEvent, release, dpy, GenericEvent, xi2_opcode, XI_ButtonRelease); break; @@ -2257,6 +2260,7 @@ TEST_F(TouchOwnershipTest, ActivePointerGrabForWholeTouch) TouchDev().TouchBegin(200, 200, 0); + ASSERT_EVENT(XIDeviceEvent, A_motion1, dpy, GenericEvent, xi2_opcode, XI_Motion); ASSERT_EVENT(XIDeviceEvent, A_btnpress, dpy, GenericEvent, xi2_opcode, XI_ButtonPress); ASSERT_EVENT(XIDeviceEvent, B_begin, dpy2, GenericEvent, xi2_opcode, XI_TouchBegin); @@ -2266,6 +2270,7 @@ TEST_F(TouchOwnershipTest, ActivePointerGrabForWholeTouch) TouchDev().TouchEnd(250, 250, 0); + ASSERT_EVENT(XIDeviceEvent, A_motion2, dpy, GenericEvent, xi2_opcode, XI_Motion); ASSERT_EVENT(XIDeviceEvent, A_btnrelease, dpy, GenericEvent, xi2_opcode, XI_ButtonRelease); /* One event on the wire and it's TouchEnd, not ownership */ @@ -2301,6 +2306,7 @@ TEST_F(TouchOwnershipTest, ActivePointerUngrabDuringTouch) TouchDev().TouchBegin(200, 200, 0); + ASSERT_EVENT(XIDeviceEvent, A_motion1, dpy, GenericEvent, xi2_opcode, XI_Motion); ASSERT_EVENT(XIDeviceEvent, A_btnpress, dpy, GenericEvent, xi2_opcode, XI_ButtonPress); ASSERT_EVENT(XIDeviceEvent, B_begin, dpy2, GenericEvent, xi2_opcode, XI_TouchBegin); |