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/setbmap.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/setbmap.c')
-rw-r--r-- | xorg-server/Xi/setbmap.c | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/xorg-server/Xi/setbmap.c b/xorg-server/Xi/setbmap.c index f05225531..37c40e408 100644 --- a/xorg-server/Xi/setbmap.c +++ b/xorg-server/Xi/setbmap.c @@ -50,11 +50,6 @@ SOFTWARE. * */ -#define NEED_EVENTS -#define NEED_REPLIES -#define IsOn(ptr, bit) \ - (((BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7))) - #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif @@ -99,31 +94,30 @@ ProcXSetDeviceButtonMapping(ClientPtr client) REQUEST(xSetDeviceButtonMappingReq); REQUEST_AT_LEAST_SIZE(xSetDeviceButtonMappingReq); - if (stuff->length != (sizeof(xSetDeviceButtonMappingReq) + - stuff->map_length + 3) >> 2) + if (stuff->length != + bytes_to_int32(sizeof(xSetDeviceButtonMappingReq) + stuff->map_length)) return BadLength; + ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess); + if (ret != Success) + return ret; + rep.repType = X_Reply; rep.RepType = X_SetDeviceButtonMapping; rep.length = 0; rep.sequenceNumber = client->sequence; rep.status = MappingSuccess; - ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess); - if (ret != Success) - return ret; - - ret = SetButtonMapping(client, dev, stuff->map_length, (BYTE *) & stuff[1]); + ret = ApplyPointerMapping(dev, (CARD8 *) &stuff[1], stuff->map_length, client); + if (ret == -1) + return BadValue; + else if (ret == MappingBusy) + rep.status = ret; + else if (ret != Success) + return ret; - if (ret == BadValue || ret == BadMatch) - return ret; - else { - rep.status = ret; - WriteReplyToClient(client, sizeof(xSetDeviceButtonMappingReply), &rep); - } + WriteReplyToClient(client, sizeof(xSetDeviceButtonMappingReply), &rep); - if (ret != MappingBusy) - SendDeviceMappingNotify(client, MappingPointer, 0, 0, dev); return Success; } |