GitLab will be down for maintenance this Sunday 13th June, from approx 7-11am UTC. This is for a PostgreSQL migration. See the tracker issue for more informations.

Commit 687d4517 authored by Povilas Kanapickas's avatar Povilas Kanapickas
Browse files

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.
parent e36311a6
Pipeline #251879 passed with stages
in 1 minute and 4 seconds
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment