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:
parent
02930c99fe
commit
ec118ccbb8
10
dix/events.c
10
dix/events.c
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -746,7 +746,7 @@ ReplySwapPtr ReplySwapVector[256] = {
|
|||
ReplyNotSwappd,
|
||||
ReplyNotSwappd,
|
||||
ReplyNotSwappd, /* 30 */
|
||||
(ReplySwapPtr) SGenericReply, /* SGrabKeyboardReply, */
|
||||
ReplyNotSwappd,
|
||||
ReplyNotSwappd,
|
||||
ReplyNotSwappd,
|
||||
ReplyNotSwappd,
|
||||
|
|
Loading…
Reference in New Issue