dix: write out X_GetInputFocus 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:
Enrico Weigelt, metux IT consult 2025-04-04 18:43:55 +02:00
parent eb184c316d
commit d5d56b8c29
4 changed files with 7 additions and 16 deletions

View File

@ -4972,7 +4972,6 @@ int
ProcGetInputFocus(ClientPtr client)
{
DeviceIntPtr kbd = PickKeyboard(client);
xGetInputFocusReply rep;
FocusClassPtr focus = kbd->focus;
int rc;
@ -4983,7 +4982,7 @@ ProcGetInputFocus(ClientPtr client)
if (rc != Success)
return rc;
rep = (xGetInputFocusReply) {
xGetInputFocusReply rep = {
.type = X_Reply,
.length = 0,
.sequenceNumber = client->sequence,
@ -4997,7 +4996,11 @@ ProcGetInputFocus(ClientPtr client)
else
rep.focus = focus->win->drawable.id;
WriteReplyToClient(client, sizeof(xGetInputFocusReply), &rep);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.focus);
}
WriteToClient(client, sizeof(rep), &rep);
return Success;
}

View File

@ -239,14 +239,6 @@ SwapTimeCoordWrite(ClientPtr pClient, int size, xTimecoord * pRep)
}
void _X_COLD
SGetInputFocusReply(ClientPtr pClient, int size, xGetInputFocusReply * pRep)
{
swaps(&pRep->sequenceNumber);
swapl(&pRep->focus);
WriteToClient(pClient, size, pRep);
}
static void _X_COLD
SwapCharInfo(xCharInfo * pInfo)
{

View File

@ -758,7 +758,7 @@ ReplySwapPtr ReplySwapVector[256] = {
ReplyNotSwappd, /* 40 */
ReplyNotSwappd,
ReplyNotSwappd,
(ReplySwapPtr) SGetInputFocusReply,
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd, /* 45 */
ReplyNotSwappd,

View File

@ -60,10 +60,6 @@ extern void SwapTimeCoordWrite(ClientPtr /* pClient */ ,
int /* size */ ,
xTimecoord * /* pRep */ );
extern void SGetInputFocusReply(ClientPtr /* pClient */ ,
int /* size */ ,
xGetInputFocusReply * /* pRep */ );
extern void SListExtensionsReply(ClientPtr /* pClient */ ,
int /* size */ ,
xListExtensionsReply * /* pRep */ );