diff options
author | marha <marha@users.sourceforge.net> | 2009-09-09 05:23:48 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-09-09 05:23:48 +0000 |
commit | 81f91c615982e50bb62708201569c33a3cd3d973 (patch) | |
tree | 4f32ecc48a3b7b5e76642f3792338263c53879bd /xorg-server/Xi/grabdev.c | |
parent | b571a562410f565af2bdde52d9f7f9a23ffae04f (diff) | |
parent | a915739887477b28d924ecc8417ee107d125bd6c (diff) | |
download | vcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.tar.gz vcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.tar.bz2 vcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.zip |
svn merge https://vcxsrv.svn.sourceforge.net/svnroot/vcxsrv/branches/released .
Diffstat (limited to 'xorg-server/Xi/grabdev.c')
-rw-r--r-- | xorg-server/Xi/grabdev.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/xorg-server/Xi/grabdev.c b/xorg-server/Xi/grabdev.c index 8217a9928..925c9a6d2 100644 --- a/xorg-server/Xi/grabdev.c +++ b/xorg-server/Xi/grabdev.c @@ -50,8 +50,6 @@ SOFTWARE. * */ -#define NEED_EVENTS -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif @@ -86,7 +84,7 @@ SProcXGrabDevice(ClientPtr client) swapl(&stuff->time, n); swaps(&stuff->event_count, n); - if (stuff->length != (sizeof(xGrabDeviceReq) >> 2) + stuff->event_count) + if (stuff->length != bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count) return BadLength; SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count); @@ -106,12 +104,13 @@ ProcXGrabDevice(ClientPtr client) int rc; xGrabDeviceReply rep; DeviceIntPtr dev; + GrabMask mask; struct tmask tmp[EMASKSIZE]; REQUEST(xGrabDeviceReq); REQUEST_AT_LEAST_SIZE(xGrabDeviceReq); - if (stuff->length != (sizeof(xGrabDeviceReq) >> 2) + stuff->event_count) + if (stuff->length != bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count) return BadLength; rep.repType = X_Reply; @@ -128,10 +127,13 @@ ProcXGrabDevice(ClientPtr client) X_GrabDevice)) != Success) return rc; - rc = GrabDevice(client, dev, stuff->this_device_mode, - stuff->other_devices_mode, stuff->grabWindow, + mask.xi = tmp[stuff->deviceid].mask; + + rc = GrabDevice(client, dev, stuff->other_devices_mode, + stuff->this_device_mode, stuff->grabWindow, stuff->ownerEvents, stuff->time, - tmp[stuff->deviceid].mask, &rep.status, FALSE); + &mask, GRABTYPE_XI, None, None, + &rep.status); if (rc != Success) return rc; @@ -179,10 +181,10 @@ CreateMaskFromList(ClientPtr client, XEventClass * list, int count, for (i = 0; i < count; i++, list++) { device = *list >> 8; - if (device > 255) /* FIXME: we only use 7 bit for devices? */ + if (device > 255) return BadClass; - rc = dixLookupDevice(&tdev, device, client, DixReadAccess); + rc = dixLookupDevice(&tdev, device, client, DixUseAccess); if (rc != BadDevice && rc != Success) return rc; if (rc == BadDevice || (dev != NULL && tdev != dev)) |