XI: directly write out X_GetDeviceKeyMapping reply
Write out X_GetDeviceKeyMapping the reply directly (and do the swapping within the request handler) instead of going through separate callback that's having demux the replies again. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
e226b1396a
commit
7f36272a3d
|
@ -421,10 +421,7 @@ SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep)
|
||||||
{
|
{
|
||||||
/* All we look at is the type field */
|
/* All we look at is the type field */
|
||||||
/* This is common to all replies */
|
/* This is common to all replies */
|
||||||
if (rep->RepType == X_GetDeviceKeyMapping)
|
if (rep->RepType == X_GetDeviceModifierMapping)
|
||||||
SRepXGetDeviceKeyMapping(client, len,
|
|
||||||
(xGetDeviceKeyMappingReply *) rep);
|
|
||||||
else if (rep->RepType == X_GetDeviceModifierMapping)
|
|
||||||
SRepXGetDeviceModifierMapping(client, len,
|
SRepXGetDeviceModifierMapping(client, len,
|
||||||
(xGetDeviceModifierMappingReply *) rep);
|
(xGetDeviceModifierMappingReply *) rep);
|
||||||
else if (rep->RepType == X_SetDeviceModifierMapping)
|
else if (rep->RepType == X_SetDeviceModifierMapping)
|
||||||
|
|
23
Xi/getkmap.c
23
Xi/getkmap.c
|
@ -108,7 +108,12 @@ ProcXGetDeviceKeyMapping(ClientPtr client)
|
||||||
.keySymsPerKeyCode = syms->mapWidth,
|
.keySymsPerKeyCode = syms->mapWidth,
|
||||||
.length = (syms->mapWidth * stuff->count) /* KeySyms are 4 bytes */
|
.length = (syms->mapWidth * stuff->count) /* KeySyms are 4 bytes */
|
||||||
};
|
};
|
||||||
WriteReplyToClient(client, sizeof(xGetDeviceKeyMappingReply), &rep);
|
|
||||||
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swapl(&rep.length);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(xGetDeviceKeyMappingReply), &rep);
|
||||||
|
|
||||||
client->pSwapReplyFunc = (ReplySwapPtr) CopySwap32Write;
|
client->pSwapReplyFunc = (ReplySwapPtr) CopySwap32Write;
|
||||||
WriteSwappedDataToClient(client,
|
WriteSwappedDataToClient(client,
|
||||||
|
@ -120,19 +125,3 @@ ProcXGetDeviceKeyMapping(ClientPtr client)
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
*
|
|
||||||
* This procedure writes the reply for the XGetDeviceKeyMapping function,
|
|
||||||
* if the client and server have a different byte ordering.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SRepXGetDeviceKeyMapping(ClientPtr client, int size,
|
|
||||||
xGetDeviceKeyMappingReply * rep)
|
|
||||||
{
|
|
||||||
swaps(&rep->sequenceNumber);
|
|
||||||
swapl(&rep->length);
|
|
||||||
WriteToClient(client, size, rep);
|
|
||||||
}
|
|
||||||
|
|
|
@ -33,9 +33,4 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
int ProcXGetDeviceKeyMapping(ClientPtr /* client */
|
int ProcXGetDeviceKeyMapping(ClientPtr /* client */
|
||||||
);
|
);
|
||||||
|
|
||||||
void SRepXGetDeviceKeyMapping(ClientPtr /* client */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xGetDeviceKeyMappingReply * /* rep */
|
|
||||||
);
|
|
||||||
|
|
||||||
#endif /* GETKMAP_H */
|
#endif /* GETKMAP_H */
|
||||||
|
|
Loading…
Reference in New Issue