aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/Xi/setbmap.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-09-06 18:48:27 +0000
committermarha <marha@users.sourceforge.net>2009-09-06 18:48:27 +0000
commita915739887477b28d924ecc8417ee107d125bd6c (patch)
treec02f315476b61892d1fd89182e18943dce8d6277 /xorg-server/Xi/setbmap.c
parent6f25a23db1df27e992c34f6fd4c82e83c44fc2e2 (diff)
downloadvcxsrv-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/setbmap.c')
-rw-r--r--xorg-server/Xi/setbmap.c34
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;
}