dix: write out X_SetPointerMapping reply directly
No need for using a complex callback machinery, if we just move the little pieces of byte-swapping directly into the request handler. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
6091ce6d57
commit
1ef0e46cbc
|
@ -1888,7 +1888,6 @@ ProcSetPointerMapping(ClientPtr client)
|
|||
int ret;
|
||||
int i, j;
|
||||
DeviceIntPtr ptr = PickPointer(client);
|
||||
xSetPointerMappingReply rep;
|
||||
|
||||
REQUEST(xSetPointerMappingReq);
|
||||
REQUEST_AT_LEAST_SIZE(xSetPointerMappingReq);
|
||||
|
@ -1897,12 +1896,6 @@ ProcSetPointerMapping(ClientPtr client)
|
|||
bytes_to_int32(sizeof(xSetPointerMappingReq) + stuff->nElts))
|
||||
return BadLength;
|
||||
|
||||
rep = (xSetPointerMappingReply) {
|
||||
.type = X_Reply,
|
||||
.success = MappingSuccess,
|
||||
.sequenceNumber = client->sequence,
|
||||
.length = 0
|
||||
};
|
||||
map = (BYTE *) &stuff[1];
|
||||
|
||||
/* So we're bounded here by the number of core buttons. This check
|
||||
|
@ -1928,14 +1921,24 @@ ProcSetPointerMapping(ClientPtr client)
|
|||
}
|
||||
|
||||
ret = ApplyPointerMapping(ptr, map, stuff->nElts, client);
|
||||
if (ret == MappingBusy)
|
||||
rep.success = ret;
|
||||
else if (ret == -1)
|
||||
|
||||
if (ret == -1)
|
||||
return BadValue;
|
||||
else if (ret != Success)
|
||||
if (ret != Success && ret != MappingBusy)
|
||||
return ret;
|
||||
|
||||
WriteReplyToClient(client, sizeof(xSetPointerMappingReply), &rep);
|
||||
xSetPointerMappingReply rep = {
|
||||
.type = X_Reply,
|
||||
.success = MappingSuccess,
|
||||
.sequenceNumber = client->sequence,
|
||||
.success = ret,
|
||||
};
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber);
|
||||
}
|
||||
|
||||
WriteToClient(client, sizeof(rep), &rep);
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
|
|
@ -831,7 +831,7 @@ ReplySwapPtr ReplySwapVector[256] = {
|
|||
ReplyNotSwappd,
|
||||
ReplyNotSwappd,
|
||||
ReplyNotSwappd, /* 115 */
|
||||
(ReplySwapPtr) SGenericReply, /* SetPointerMapping */
|
||||
ReplyNotSwappd,
|
||||
(ReplySwapPtr) SGetPointerMappingReply,
|
||||
ReplyNotSwappd,
|
||||
ReplyNotSwappd, /* 119 */
|
||||
|
|
Loading…
Reference in New Issue