dix: write out xGetKeyboardMappingReply directly

This commit is contained in:
Enrico Weigelt, metux IT consult
2025-04-03 16:13:17 +02:00
parent 917671c83c
commit c7ded3fc6c
4 changed files with 9 additions and 18 deletions

View File

@@ -1962,7 +1962,6 @@ ProcSetPointerMapping(ClientPtr client)
int
ProcGetKeyboardMapping(ClientPtr client)
{
xGetKeyboardMappingReply rep;
DeviceIntPtr kbd = PickKeyboard(client);
XkbDescPtr xkb;
KeySymsPtr syms;
@@ -1991,14 +1990,20 @@ ProcGetKeyboardMapping(ClientPtr client)
if (!syms)
return BadAlloc;
rep = (xGetKeyboardMappingReply) {
xGetKeyboardMappingReply rep = {
.type = X_Reply,
.keySymsPerKeyCode = syms->mapWidth,
.sequenceNumber = client->sequence,
/* length is a count of 4 byte quantities and KeySyms are 4 bytes */
.length = syms->mapWidth * stuff->count
};
WriteReplyToClient(client, sizeof(xGetKeyboardMappingReply), &rep);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
}
WriteToClient(client, sizeof(rep), &rep);
client->pSwapReplyFunc = (ReplySwapPtr) CopySwap32Write;
WriteSwappedDataToClient(client,
syms->mapWidth * stuff->count * sizeof(KeySym),

View File

@@ -535,15 +535,6 @@ SListExtensionsReply(ClientPtr pClient, int size, xListExtensionsReply * pRep)
WriteToClient(pClient, size, pRep);
}
void _X_COLD
SGetKeyboardMappingReply(ClientPtr pClient, int size,
xGetKeyboardMappingReply * pRep)
{
swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
WriteToClient(pClient, size, pRep);
}
void _X_COLD
SGetKeyboardControlReply(ClientPtr pClient, int size,
xGetKeyboardControlReply * pRep)

View File

@@ -817,7 +817,7 @@ ReplySwapPtr ReplySwapVector[256] = {
(ReplySwapPtr) SGenericReply, /* SQueryExtensionReply, */
(ReplySwapPtr) SListExtensionsReply,
ReplyNotSwappd, /* 100 */
(ReplySwapPtr) SGetKeyboardMappingReply,
ReplyNotSwappd,
ReplyNotSwappd,
(ReplySwapPtr) SGetKeyboardControlReply,
ReplyNotSwappd,

View File

@@ -154,11 +154,6 @@ extern void SListExtensionsReply(ClientPtr /* pClient */ ,
int /* size */ ,
xListExtensionsReply * /* pRep */ );
extern void SGetKeyboardMappingReply(ClientPtr /* pClient */ ,
int /* size */ ,
xGetKeyboardMappingReply *
/* pRep */ );
extern void SGetKeyboardControlReply(ClientPtr /* pClient */ ,
int /* size */ ,
xGetKeyboardControlReply *