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
d9b9906c45
commit
95878b2dd3
|
@ -1899,7 +1899,6 @@ ProcSetPointerMapping(ClientPtr client)
|
|||
int ret;
|
||||
int i, j;
|
||||
DeviceIntPtr ptr = PickPointer(client);
|
||||
xSetPointerMappingReply rep;
|
||||
|
||||
REQUEST(xSetPointerMappingReq);
|
||||
REQUEST_AT_LEAST_SIZE(xSetPointerMappingReq);
|
||||
|
@ -1908,12 +1907,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
|
||||
|
@ -1939,14 +1932,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;
|
||||
}
|
||||
|
||||
|
|
|
@ -828,7 +828,7 @@ ReplySwapPtr ReplySwapVector[256] = {
|
|||
ReplyNotSwappd,
|
||||
ReplyNotSwappd,
|
||||
ReplyNotSwappd, /* 115 */
|
||||
(ReplySwapPtr) SGenericReply, /* SetPointerMapping */
|
||||
ReplyNotSwappd,
|
||||
(ReplySwapPtr) SGetPointerMappingReply,
|
||||
ReplyNotSwappd,
|
||||
ReplyNotSwappd, /* 119 */
|
||||
|
|
Loading…
Reference in New Issue