dix: write out X_GrabKeyboard 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:48:46 +02:00
parent 02930c99fe
commit ec118ccbb8
2 changed files with 8 additions and 4 deletions

View File

@ -5278,7 +5278,6 @@ GrabDevice(ClientPtr client, DeviceIntPtr dev,
int
ProcGrabKeyboard(ClientPtr client)
{
xGrabKeyboardReply rep;
BYTE status;
REQUEST(xGrabKeyboardReq);
@ -5299,13 +5298,18 @@ ProcGrabKeyboard(ClientPtr client)
if (result != Success)
return result;
rep = (xGrabKeyboardReply) {
xGrabKeyboardReply rep = {
.type = X_Reply,
.status = status,
.sequenceNumber = client->sequence,
.length = 0
};
WriteReplyToClient(client, sizeof(xGrabKeyboardReply), &rep);
if (client->swapped) {
swaps(&rep.sequenceNumber);
}
WriteToClient(client, sizeof(rep), &rep);
return Success;
}

View File

@ -746,7 +746,7 @@ ReplySwapPtr ReplySwapVector[256] = {
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd, /* 30 */
(ReplySwapPtr) SGenericReply, /* SGrabKeyboardReply, */
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd,
ReplyNotSwappd,