dix: write out X_GetModifierMapping 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
80d748e1cd
commit
6091ce6d57
|
@ -1793,7 +1793,6 @@ ProcSetModifierMapping(ClientPtr client)
|
|||
int
|
||||
ProcGetModifierMapping(ClientPtr client)
|
||||
{
|
||||
xGetModifierMappingReply rep;
|
||||
int max_keys_per_mod = 0;
|
||||
KeyCode *modkeymap = NULL;
|
||||
|
||||
|
@ -1802,15 +1801,20 @@ ProcGetModifierMapping(ClientPtr client)
|
|||
generate_modkeymap(client, PickKeyboard(client), &modkeymap,
|
||||
&max_keys_per_mod);
|
||||
|
||||
rep = (xGetModifierMappingReply) {
|
||||
xGetModifierMappingReply rep = {
|
||||
.type = X_Reply,
|
||||
.numKeyPerModifier = max_keys_per_mod,
|
||||
.sequenceNumber = client->sequence,
|
||||
/* length counts 4 byte quantities - there are 8 modifiers 1 byte big */
|
||||
/* length counts 4 byte quantities - there are 8 modifiers 1 byte big */
|
||||
.length = max_keys_per_mod << 1
|
||||
};
|
||||
|
||||
WriteReplyToClient(client, sizeof(xGetModifierMappingReply), &rep);
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
}
|
||||
|
||||
WriteToClient(client, sizeof(rep), &rep);
|
||||
WriteToClient(client, max_keys_per_mod * 8, modkeymap);
|
||||
|
||||
free(modkeymap);
|
||||
|
|
|
@ -553,15 +553,6 @@ SGetPointerMappingReply(ClientPtr pClient, int size,
|
|||
WriteToClient(pClient, size, pRep);
|
||||
}
|
||||
|
||||
void _X_COLD
|
||||
SGetModifierMappingReply(ClientPtr pClient, int size,
|
||||
xGetModifierMappingReply * pRep)
|
||||
{
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swapl(&pRep->length);
|
||||
WriteToClient(pClient, size, pRep);
|
||||
}
|
||||
|
||||
void _X_COLD
|
||||
SGetKeyboardControlReply(ClientPtr pClient, int size,
|
||||
xGetKeyboardControlReply * pRep)
|
||||
|
|
|
@ -834,7 +834,7 @@ ReplySwapPtr ReplySwapVector[256] = {
|
|||
(ReplySwapPtr) SGenericReply, /* SetPointerMapping */
|
||||
(ReplySwapPtr) SGetPointerMappingReply,
|
||||
ReplyNotSwappd,
|
||||
(ReplySwapPtr) SGetModifierMappingReply, /* 119 */
|
||||
ReplyNotSwappd, /* 119 */
|
||||
ReplyNotSwappd, /* 120 */
|
||||
ReplyNotSwappd, /* 121 */
|
||||
ReplyNotSwappd, /* 122 */
|
||||
|
|
|
@ -164,11 +164,6 @@ extern void SGetPointerMappingReply(ClientPtr /* pClient */ ,
|
|||
xGetPointerMappingReply *
|
||||
/* pRep */ );
|
||||
|
||||
extern void SGetModifierMappingReply(ClientPtr /* pClient */ ,
|
||||
int /* size */ ,
|
||||
xGetModifierMappingReply *
|
||||
/* pRep */ );
|
||||
|
||||
extern void SGetKeyboardControlReply(ClientPtr /* pClient */ ,
|
||||
int /* size */ ,
|
||||
xGetKeyboardControlReply *
|
||||
|
|
Loading…
Reference in New Issue