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

View File

@ -5013,7 +5013,6 @@ ProcGetInputFocus(ClientPtr client)
int int
ProcGrabPointer(ClientPtr client) ProcGrabPointer(ClientPtr client)
{ {
xGrabPointerReply rep;
DeviceIntPtr device = PickPointer(client); DeviceIntPtr device = PickPointer(client);
GrabPtr grab; GrabPtr grab;
GrabMask mask; GrabMask mask;
@ -5053,13 +5052,17 @@ ProcGrabPointer(ClientPtr client)
if (rc != Success) if (rc != Success)
return rc; return rc;
rep = (xGrabPointerReply) { xGrabPointerReply rep = {
.type = X_Reply, .type = X_Reply,
.status = status, .status = status,
.sequenceNumber = client->sequence, .sequenceNumber = client->sequence,
.length = 0 .length = 0
}; };
WriteReplyToClient(client, sizeof(xGrabPointerReply), &rep);
if (client->swapped) {
swaps(&rep.sequenceNumber);
}
WriteToClient(client, sizeof(rep), &rep);
return Success; return Success;
} }

View File

@ -741,7 +741,7 @@ ReplySwapPtr ReplySwapVector[256] = {
ReplyNotSwappd, ReplyNotSwappd,
ReplyNotSwappd, ReplyNotSwappd,
ReplyNotSwappd, /* 25 */ ReplyNotSwappd, /* 25 */
(ReplySwapPtr) SGenericReply, /* SGrabPointerReply, */ ReplyNotSwappd,
ReplyNotSwappd, ReplyNotSwappd,
ReplyNotSwappd, ReplyNotSwappd,
ReplyNotSwappd, ReplyNotSwappd,