summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/server/barriers-notify.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/server/barriers-notify.cpp b/tests/server/barriers-notify.cpp
index 7b82a3e..970e9d3 100644
--- a/tests/server/barriers-notify.cpp
+++ b/tests/server/barriers-notify.cpp
@@ -408,24 +408,60 @@ TEST_F(BarrierNotify, EventsDuringActiveGrabNonGrabWindow)
XIGrabDevice(dpy, VIRTUAL_CORE_POINTER_ID, win, CurrentTime, None, GrabModeAsync, GrabModeAsync, True, &no_mask);
dev->PlayOne(EV_REL, REL_X, -40, True);
ASSERT_TRUE(xorg::testing::XServer::WaitForEventOfType(dpy, GenericEvent, xi2_opcode, XI_BarrierHit, 500));
+ {
+ XITEvent<XIBarrierEvent> hit(dpy, GenericEvent, xi2_opcode, XI_BarrierHit);
+ ASSERT_TRUE(hit.ev);
+ ASSERT_EQ(hit.ev->window, root);
+ ASSERT_EQ(hit.ev->root, root);
+ ASSERT_EQ(hit.ev->barrier, barrier);
+ ASSERT_EQ(hit.ev->root_x, 20);
+ ASSERT_EQ(hit.ev->root_y, 30);
+ }
/* if OE is false and mask is not set, but set on window → event */
XIWarpPointer(dpy, VIRTUAL_CORE_POINTER_ID, None, root, 0, 0, 0, 0, 30, 30);
XIGrabDevice(dpy, VIRTUAL_CORE_POINTER_ID, win, CurrentTime, None, GrabModeAsync, GrabModeAsync, False, &no_mask);
dev->PlayOne(EV_REL, REL_X, -40, True);
ASSERT_TRUE(xorg::testing::XServer::WaitForEventOfType(dpy, GenericEvent, xi2_opcode, XI_BarrierHit, 500));
+ {
+ XITEvent<XIBarrierEvent> hit(dpy, GenericEvent, xi2_opcode, XI_BarrierHit);
+ ASSERT_TRUE(hit.ev);
+ ASSERT_EQ(hit.ev->window, root);
+ ASSERT_EQ(hit.ev->root, root);
+ ASSERT_EQ(hit.ev->barrier, barrier);
+ ASSERT_EQ(hit.ev->root_x, 20);
+ ASSERT_EQ(hit.ev->root_y, 30);
+ }
/* if OE is true and mask is set → event */
XIWarpPointer(dpy, VIRTUAL_CORE_POINTER_ID, None, root, 0, 0, 0, 0, 30, 30);
XIGrabDevice(dpy, VIRTUAL_CORE_POINTER_ID, win, CurrentTime, None, GrabModeAsync, GrabModeAsync, True, &event_mask);
dev->PlayOne(EV_REL, REL_X, -40, True);
ASSERT_TRUE(xorg::testing::XServer::WaitForEventOfType(dpy, GenericEvent, xi2_opcode, XI_BarrierHit, 500));
+ {
+ XITEvent<XIBarrierEvent> hit(dpy, GenericEvent, xi2_opcode, XI_BarrierHit);
+ ASSERT_TRUE(hit.ev);
+ ASSERT_EQ(hit.ev->window, root);
+ ASSERT_EQ(hit.ev->root, root);
+ ASSERT_EQ(hit.ev->barrier, barrier);
+ ASSERT_EQ(hit.ev->root_x, 20);
+ ASSERT_EQ(hit.ev->root_y, 30);
+ }
/* if OE is false and mask is set → event */
XIWarpPointer(dpy, VIRTUAL_CORE_POINTER_ID, None, root, 0, 0, 0, 0, 30, 30);
XIGrabDevice(dpy, VIRTUAL_CORE_POINTER_ID, win, CurrentTime, None, GrabModeAsync, GrabModeAsync, False, &event_mask);
dev->PlayOne(EV_REL, REL_X, -40, True);
ASSERT_TRUE(xorg::testing::XServer::WaitForEventOfType(dpy, GenericEvent, xi2_opcode, XI_BarrierHit, 500));
+ {
+ XITEvent<XIBarrierEvent> hit(dpy, GenericEvent, xi2_opcode, XI_BarrierHit);
+ ASSERT_TRUE(hit.ev);
+ ASSERT_EQ(hit.ev->window, root);
+ ASSERT_EQ(hit.ev->root, root);
+ ASSERT_EQ(hit.ev->barrier, barrier);
+ ASSERT_EQ(hit.ev->root_x, 20);
+ ASSERT_EQ(hit.ev->root_y, 30);
+ }
XFixesDestroyPointerBarrier(dpy, barrier);
}
@@ -461,6 +497,15 @@ TEST_F(BarrierNotify, EventsDuringActiveGrabOtherClient)
XISelectEvents(dpy, root, &event_mask, 1);
dev->PlayOne(EV_REL, REL_X, -40, True);
ASSERT_TRUE(xorg::testing::XServer::WaitForEventOfType(dpy, GenericEvent, xi2_opcode, XI_BarrierHit, 500));
+ {
+ XITEvent<XIBarrierEvent> hit(dpy, GenericEvent, xi2_opcode, XI_BarrierHit);
+ ASSERT_TRUE(hit.ev);
+ ASSERT_EQ(hit.ev->window, root);
+ ASSERT_EQ(hit.ev->root, root);
+ ASSERT_EQ(hit.ev->barrier, barrier);
+ ASSERT_EQ(hit.ev->root_x, 20);
+ ASSERT_EQ(hit.ev->root_y, 30);
+ }
XFixesDestroyPointerBarrier(dpy, barrier);
}