diff --git a/Xi/extinit.c b/Xi/extinit.c index 1aba852eb..19ad68bec 100644 --- a/Xi/extinit.c +++ b/Xi/extinit.c @@ -421,9 +421,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 43b93b8c9..e8caa61f4 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 8a180bf39..5f6fee3db 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);