diff options
author | marha <marha@users.sourceforge.net> | 2009-09-06 18:48:27 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-09-06 18:48:27 +0000 |
commit | a915739887477b28d924ecc8417ee107d125bd6c (patch) | |
tree | c02f315476b61892d1fd89182e18943dce8d6277 /xorg-server/Xi/grabdev.c | |
parent | 6f25a23db1df27e992c34f6fd4c82e83c44fc2e2 (diff) | |
download | vcxsrv-a915739887477b28d924ecc8417ee107d125bd6c.tar.gz vcxsrv-a915739887477b28d924ecc8417ee107d125bd6c.tar.bz2 vcxsrv-a915739887477b28d924ecc8417ee107d125bd6c.zip |
Switched to xorg-server-1.6.99.900.tar.gz
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)) |