XI: directly write out X_GrabDevice reply
Write out X_GrabDevice the reply directly (and do the swapping within the request handler) instead of going through separate callback that's having demux the replies again. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
d4bd6bad8d
commit
96e6a517c9
|
@ -421,9 +421,7 @@ SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep)
|
||||||
{
|
{
|
||||||
/* All we look at is the type field */
|
/* All we look at is the type field */
|
||||||
/* This is common to all replies */
|
/* This is common to all replies */
|
||||||
if (rep->RepType == X_GrabDevice)
|
if (rep->RepType == X_GetDeviceFocus)
|
||||||
SRepXGrabDevice(client, len, (xGrabDeviceReply *) rep);
|
|
||||||
else if (rep->RepType == X_GetDeviceFocus)
|
|
||||||
SRepXGetDeviceFocus(client, len, (xGetDeviceFocusReply *) rep);
|
SRepXGetDeviceFocus(client, len, (xGetDeviceFocusReply *) rep);
|
||||||
else if (rep->RepType == X_GetFeedbackControl)
|
else if (rep->RepType == X_GetFeedbackControl)
|
||||||
SRepXGetFeedbackControl(client, len, (xGetFeedbackControlReply *) rep);
|
SRepXGetFeedbackControl(client, len, (xGetFeedbackControlReply *) rep);
|
||||||
|
|
21
Xi/grabdev.c
21
Xi/grabdev.c
|
@ -137,7 +137,11 @@ ProcXGrabDevice(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
WriteReplyToClient(client, sizeof(xGrabDeviceReply), &rep);
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swapl(&rep.length);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(xGrabDeviceReply), &rep);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,18 +199,3 @@ CreateMaskFromList(ClientPtr client, XEventClass * list, int count,
|
||||||
}
|
}
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
*
|
|
||||||
* This procedure writes the reply for the XGrabDevice function,
|
|
||||||
* if the client and server have a different byte ordering.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SRepXGrabDevice(ClientPtr client, int size, xGrabDeviceReply * rep)
|
|
||||||
{
|
|
||||||
swaps(&rep->sequenceNumber);
|
|
||||||
swapl(&rep->length);
|
|
||||||
WriteToClient(client, size, rep);
|
|
||||||
}
|
|
||||||
|
|
|
@ -44,9 +44,4 @@ int CreateMaskFromList(ClientPtr /* client */ ,
|
||||||
int /* req */
|
int /* req */
|
||||||
);
|
);
|
||||||
|
|
||||||
void SRepXGrabDevice(ClientPtr /* client */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xGrabDeviceReply * /* rep */
|
|
||||||
);
|
|
||||||
|
|
||||||
#endif /* GRABDEV_H */
|
#endif /* GRABDEV_H */
|
||||||
|
|
Loading…
Reference in New Issue