summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-12-06 12:20:25 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2012-12-06 12:20:25 +1000
commite94b68a57eaed1a51f2293d2dc679fe22bee2e1b (patch)
treea1656da448bc82e5821679f2e96a638e0e9297b2
parent1b8ab8cee86beb118164792771c796737df29e71 (diff)
server/barriers: releasing other client's barriers is not allowed
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--tests/server/barriers-validity.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/server/barriers-validity.cpp b/tests/server/barriers-validity.cpp
index 4019b07..0112739 100644
--- a/tests/server/barriers-validity.cpp
+++ b/tests/server/barriers-validity.cpp
@@ -10,6 +10,7 @@
#include <X11/extensions/XInput.h>
#include <X11/extensions/XInput2.h>
+#include "xit-event.h"
#include "barriers-common.h"
#include "helpers.h"
@@ -64,6 +65,27 @@ TEST_F(BarrierSimpleTest, MultipleClientSecurity)
XFixesDestroyPointerBarrier(dpy2, barrier);
const XErrorEvent *error = ReleaseErrorTrap(dpy2);
ASSERT_ERROR(error, BadAccess);
+
+ XIEventMask mask;
+ mask.deviceid = XIAllMasterDevices;
+ mask.mask_len = XIMaskLen(XI_LASTEVENT);
+ mask.mask = new unsigned char[mask.mask_len]();
+ XISetMask(mask.mask, XI_BarrierHit);
+ XISelectEvents(dpy1, root, &mask, 1);
+ delete[] mask.mask;
+
+ XIWarpPointer(dpy1, VIRTUAL_CORE_POINTER_ID, None, root, 0, 0, 0, 0, 30, 30);
+ XSync(dpy1, False);
+
+ dev->PlayOne(EV_REL, REL_X, -40, True);
+
+ XITEvent<XIBarrierEvent> event(dpy1, GenericEvent, xi2_opcode, XI_BarrierHit);
+ ASSERT_EQ(XPending(dpy2), 0);
+
+ SetErrorTrap(dpy2);
+ XIBarrierReleasePointer(dpy2, VIRTUAL_CORE_POINTER_ID, event.ev->barrier, 1);
+ error = ReleaseErrorTrap(dpy2);
+ ASSERT_ERROR(error, BadAccess);
}
TEST_F(BarrierSimpleTest, PixmapsNotAllowed)