summaryrefslogtreecommitdiff
path: root/xserver/test/xi2/protocol-xipassivegrabdevice.c
diff options
context:
space:
mode:
Diffstat (limited to 'xserver/test/xi2/protocol-xipassivegrabdevice.c')
-rw-r--r--xserver/test/xi2/protocol-xipassivegrabdevice.c27
1 files changed, 10 insertions, 17 deletions
diff --git a/xserver/test/xi2/protocol-xipassivegrabdevice.c b/xserver/test/xi2/protocol-xipassivegrabdevice.c
index 95d8ebf2b..c703a1ee8 100644
--- a/xserver/test/xi2/protocol-xipassivegrabdevice.c
+++ b/xserver/test/xi2/protocol-xipassivegrabdevice.c
@@ -41,12 +41,13 @@
#include "protocol-common.h"
+ClientRec client_window;
static ClientRec client_request;
#define N_MODS 7
static uint32_t modifiers[N_MODS] = { 1, 2, 3, 4, 5, 6, 7 };
-struct test_data {
+static struct test_data {
int num_modifiers;
} testdata;
@@ -54,30 +55,22 @@ int __wrap_GrabButton(ClientPtr client, DeviceIntPtr dev,
DeviceIntPtr modifier_device, int button,
GrabParameters *param, enum InputLevel grabtype,
GrabMask *mask);
+int __real_GrabButton(ClientPtr client, DeviceIntPtr dev,
+ DeviceIntPtr modifier_device, int button,
+ GrabParameters *param, enum InputLevel grabtype,
+ GrabMask *mask);
static void reply_XIPassiveGrabDevice_data(ClientPtr client, int len,
char *data, void *closure);
int
-__wrap_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access)
-{
- if (id == root.drawable.id) {
- *win = &root;
- return Success;
- }
- else if (id == window.drawable.id) {
- *win = &window;
- return Success;
- }
-
- return __real_dixLookupWindow(win, id, client, access);
-}
-
-int
__wrap_GrabButton(ClientPtr client, DeviceIntPtr dev,
DeviceIntPtr modifier_device, int button,
GrabParameters *param, enum InputLevel grabtype,
GrabMask *mask)
{
+ if (!enable_GrabButton_wrap)
+ __real_GrabButton(client, dev, modifier_device, button, param, grabtype, mask);
+
/* Fail every odd modifier */
if (param->modifiers % 2)
return BadAccess;
@@ -252,7 +245,7 @@ test_XIPassiveGrabDevice(void)
}
int
-main(int argc, char **argv)
+protocol_xipassivegrabdevice_test(void)
{
init_simple();