diff --git a/Xi/extinit.c b/Xi/extinit.c index bce6fe9b52..8a562c76f6 100644 --- a/Xi/extinit.c +++ b/Xi/extinit.c @@ -422,9 +422,7 @@ SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep) { /* All we look at is the type field */ /* This is common to all replies */ - if (rep->RepType == X_XIQueryDevice) - SRepXIQueryDevice(client, len, (xXIQueryDeviceReply *) rep); - else if (rep->RepType == X_XIGrabDevice) + if (rep->RepType == X_XIGrabDevice) SRepXIGrabDevice(client, len, (xXIGrabDeviceReply *) rep); else if (rep->RepType == X_XIPassiveGrabDevice) SRepXIPassiveGrabDevice(client, len, (xXIPassiveGrabDeviceReply *) rep); diff --git a/Xi/xiquerydevice.c b/Xi/xiquerydevice.c index 820410331d..e746966791 100644 --- a/Xi/xiquerydevice.c +++ b/Xi/xiquerydevice.c @@ -149,25 +149,19 @@ ProcXIQueryDevice(ClientPtr client) } 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); free(ptr); free(skip); 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. */ diff --git a/Xi/xiquerydevice.h b/Xi/xiquerydevice.h index 8a180bf393..5f6fee3db9 100644 --- a/Xi/xiquerydevice.h +++ b/Xi/xiquerydevice.h @@ -35,7 +35,6 @@ int SProcXIQueryDevice(ClientPtr client); int ProcXIQueryDevice(ClientPtr client); -void SRepXIQueryDevice(ClientPtr client, int size, xXIQueryDeviceReply * rep); int SizeDeviceClasses(DeviceIntPtr dev); int ListDeviceClasses(ClientPtr client, DeviceIntPtr dev, char *any, uint16_t * nclasses);