XI: directly write out X_QueryDeviceState reply
Write out the X_QueryDeviceState 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
13cc0cdf09
commit
3695324145
|
@ -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_QueryDeviceState)
|
if (rep->RepType == X_SetDeviceValuators)
|
||||||
SRepXQueryDeviceState(client, len, (xQueryDeviceStateReply *) rep);
|
|
||||||
else if (rep->RepType == X_SetDeviceValuators)
|
|
||||||
SRepXSetDeviceValuators(client, len, (xSetDeviceValuatorsReply *) rep);
|
SRepXSetDeviceValuators(client, len, (xSetDeviceValuatorsReply *) rep);
|
||||||
else if (rep->RepType == X_GetDeviceControl)
|
else if (rep->RepType == X_GetDeviceControl)
|
||||||
SRepXGetDeviceControl(client, len, (xGetDeviceControlReply *) rep);
|
SRepXGetDeviceControl(client, len, (xGetDeviceControlReply *) rep);
|
||||||
|
|
25
Xi/queryst.c
25
Xi/queryst.c
|
@ -150,24 +150,13 @@ ProcXQueryDeviceState(ClientPtr client)
|
||||||
.length = bytes_to_int32(total_length),
|
.length = bytes_to_int32(total_length),
|
||||||
.num_classes = num_classes
|
.num_classes = num_classes
|
||||||
};
|
};
|
||||||
WriteReplyToClient(client, sizeof(xQueryDeviceStateReply), &rep);
|
|
||||||
if (total_length > 0)
|
if (client->swapped) {
|
||||||
WriteToClient(client, total_length, savbuf);
|
swaps(&rep.sequenceNumber);
|
||||||
|
swapl(&rep.length);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(xQueryDeviceStateReply), &rep);
|
||||||
|
WriteToClient(client, total_length, savbuf);
|
||||||
free(savbuf);
|
free(savbuf);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
*
|
|
||||||
* This procedure writes the reply for the XQueryDeviceState function,
|
|
||||||
* if the client and server have a different byte ordering.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SRepXQueryDeviceState(ClientPtr client, int size, xQueryDeviceStateReply * rep)
|
|
||||||
{
|
|
||||||
swaps(&rep->sequenceNumber);
|
|
||||||
swapl(&rep->length);
|
|
||||||
WriteToClient(client, size, rep);
|
|
||||||
}
|
|
||||||
|
|
|
@ -33,9 +33,4 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
int ProcXQueryDeviceState(ClientPtr /* client */
|
int ProcXQueryDeviceState(ClientPtr /* client */
|
||||||
);
|
);
|
||||||
|
|
||||||
void SRepXQueryDeviceState(ClientPtr /* client */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xQueryDeviceStateReply * /* rep */
|
|
||||||
);
|
|
||||||
|
|
||||||
#endif /* QUERYST_H */
|
#endif /* QUERYST_H */
|
||||||
|
|
Loading…
Reference in New Issue