dix: write out X_GetPointerMapping 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
1ef0e46cbc
commit
c8ea12d436
|
@ -1996,7 +1996,6 @@ ProcGetKeyboardMapping(ClientPtr client)
|
|||
int
|
||||
ProcGetPointerMapping(ClientPtr client)
|
||||
{
|
||||
xGetPointerMappingReply rep;
|
||||
|
||||
/* Apps may get different values each time they call GetPointerMapping as
|
||||
* the ClientPointer could change. */
|
||||
|
@ -2012,15 +2011,21 @@ ProcGetPointerMapping(ClientPtr client)
|
|||
return rc;
|
||||
|
||||
nElts = (butc) ? butc->numButtons : 0;
|
||||
rep = (xGetPointerMappingReply) {
|
||||
|
||||
xGetPointerMappingReply rep = {
|
||||
.type = X_Reply,
|
||||
.nElts = nElts,
|
||||
.sequenceNumber = client->sequence,
|
||||
.length = ((unsigned) nElts + (4 - 1)) / 4
|
||||
};
|
||||
WriteReplyToClient(client, sizeof(xGetPointerMappingReply), &rep);
|
||||
if (butc)
|
||||
WriteToClient(client, nElts, &butc->map[1]);
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
}
|
||||
|
||||
WriteToClient(client, sizeof(rep), &rep);
|
||||
WriteToClient(client, nElts, &butc->map[1]);
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
|
|
@ -544,15 +544,6 @@ SGetKeyboardMappingReply(ClientPtr pClient, int size,
|
|||
WriteToClient(pClient, size, pRep);
|
||||
}
|
||||
|
||||
void _X_COLD
|
||||
SGetPointerMappingReply(ClientPtr pClient, int size,
|
||||
xGetPointerMappingReply * pRep)
|
||||
{
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swapl(&pRep->length);
|
||||
WriteToClient(pClient, size, pRep);
|
||||
}
|
||||
|
||||
void _X_COLD
|
||||
SGetKeyboardControlReply(ClientPtr pClient, int size,
|
||||
xGetKeyboardControlReply * pRep)
|
||||
|
|
|
@ -832,7 +832,7 @@ ReplySwapPtr ReplySwapVector[256] = {
|
|||
ReplyNotSwappd,
|
||||
ReplyNotSwappd, /* 115 */
|
||||
ReplyNotSwappd,
|
||||
(ReplySwapPtr) SGetPointerMappingReply,
|
||||
ReplyNotSwappd,
|
||||
ReplyNotSwappd,
|
||||
ReplyNotSwappd, /* 119 */
|
||||
ReplyNotSwappd, /* 120 */
|
||||
|
|
|
@ -159,11 +159,6 @@ extern void SGetKeyboardMappingReply(ClientPtr /* pClient */ ,
|
|||
xGetKeyboardMappingReply *
|
||||
/* pRep */ );
|
||||
|
||||
extern void SGetPointerMappingReply(ClientPtr /* pClient */ ,
|
||||
int /* size */ ,
|
||||
xGetPointerMappingReply *
|
||||
/* pRep */ );
|
||||
|
||||
extern void SGetKeyboardControlReply(ClientPtr /* pClient */ ,
|
||||
int /* size */ ,
|
||||
xGetKeyboardControlReply *
|
||||
|
|
Loading…
Reference in New Issue