XI: directly write out X_XIQueryDevice reply
Write out the X_XIQueryDevice 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
34b0377bc7
commit
5bf2f662cc
|
@ -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_XIQueryDevice)
|
if (rep->RepType == X_XIGrabDevice)
|
||||||
SRepXIQueryDevice(client, len, (xXIQueryDeviceReply *) rep);
|
|
||||||
else if (rep->RepType == X_XIGrabDevice)
|
|
||||||
SRepXIGrabDevice(client, len, (xXIGrabDeviceReply *) rep);
|
SRepXIGrabDevice(client, len, (xXIGrabDeviceReply *) rep);
|
||||||
else if (rep->RepType == X_XIPassiveGrabDevice)
|
else if (rep->RepType == X_XIPassiveGrabDevice)
|
||||||
SRepXIPassiveGrabDevice(client, len, (xXIPassiveGrabDeviceReply *) rep);
|
SRepXIPassiveGrabDevice(client, len, (xXIPassiveGrabDeviceReply *) rep);
|
||||||
|
|
|
@ -149,25 +149,19 @@ ProcXIQueryDevice(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
len = rep.length * 4;
|
len = rep.length * 4;
|
||||||
WriteReplyToClient(client, sizeof(xXIQueryDeviceReply), &rep);
|
|
||||||
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swapl(&rep.length);
|
||||||
|
swaps(&rep.num_devices);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(xXIQueryDeviceReply), &rep);
|
||||||
WriteToClient(client, len, ptr);
|
WriteToClient(client, len, ptr);
|
||||||
free(ptr);
|
free(ptr);
|
||||||
free(skip);
|
free(skip);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
SRepXIQueryDevice(ClientPtr client, int size, xXIQueryDeviceReply * rep)
|
|
||||||
{
|
|
||||||
swaps(&rep->sequenceNumber);
|
|
||||||
swapl(&rep->length);
|
|
||||||
swaps(&rep->num_devices);
|
|
||||||
|
|
||||||
/* Device info is already swapped, see ProcXIQueryDevice */
|
|
||||||
|
|
||||||
WriteToClient(client, size, rep);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Whether the device should be included in the returned list.
|
* @return Whether the device should be included in the returned list.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -35,7 +35,6 @@
|
||||||
|
|
||||||
int SProcXIQueryDevice(ClientPtr client);
|
int SProcXIQueryDevice(ClientPtr client);
|
||||||
int ProcXIQueryDevice(ClientPtr client);
|
int ProcXIQueryDevice(ClientPtr client);
|
||||||
void SRepXIQueryDevice(ClientPtr client, int size, xXIQueryDeviceReply * rep);
|
|
||||||
int SizeDeviceClasses(DeviceIntPtr dev);
|
int SizeDeviceClasses(DeviceIntPtr dev);
|
||||||
int ListDeviceClasses(ClientPtr client, DeviceIntPtr dev,
|
int ListDeviceClasses(ClientPtr client, DeviceIntPtr dev,
|
||||||
char *any, uint16_t * nclasses);
|
char *any, uint16_t * nclasses);
|
||||||
|
|
Loading…
Reference in New Issue