XI: directly write out X_ChangeDeviceControl reply
Write out the X_ChangeDeviceControl 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
ffb75fee3f
commit
b573dfb6e4
22
Xi/chgdctl.c
22
Xi/chgdctl.c
|
@ -130,7 +130,6 @@ ProcXChangeDeviceControl(ClientPtr client)
|
||||||
.repType = X_Reply,
|
.repType = X_Reply,
|
||||||
.RepType = X_ChangeDeviceControl,
|
.RepType = X_ChangeDeviceControl,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = 0,
|
|
||||||
.status = Success,
|
.status = Success,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -232,24 +231,11 @@ ProcXChangeDeviceControl(ClientPtr client)
|
||||||
SendEventToAllWindows(dev, DevicePresenceNotifyMask,
|
SendEventToAllWindows(dev, DevicePresenceNotifyMask,
|
||||||
(xEvent *) &dpn, 1);
|
(xEvent *) &dpn, 1);
|
||||||
|
|
||||||
WriteReplyToClient(client, sizeof(xChangeDeviceControlReply), &rep);
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(xChangeDeviceControlReply), &rep);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
*
|
|
||||||
* This procedure writes the reply for the xChangeDeviceControl function,
|
|
||||||
* if the client and server have a different byte ordering.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SRepXChangeDeviceControl(ClientPtr client, int size,
|
|
||||||
xChangeDeviceControlReply * rep)
|
|
||||||
{
|
|
||||||
swaps(&rep->sequenceNumber);
|
|
||||||
swapl(&rep->length);
|
|
||||||
WriteToClient(client, size, rep);
|
|
||||||
}
|
|
||||||
|
|
|
@ -36,9 +36,4 @@ int SProcXChangeDeviceControl(ClientPtr /* client */
|
||||||
int ProcXChangeDeviceControl(ClientPtr /* client */
|
int ProcXChangeDeviceControl(ClientPtr /* client */
|
||||||
);
|
);
|
||||||
|
|
||||||
void SRepXChangeDeviceControl(ClientPtr /* client */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xChangeDeviceControlReply * /* rep */
|
|
||||||
);
|
|
||||||
|
|
||||||
#endif /* CHGDCTL_H */
|
#endif /* CHGDCTL_H */
|
||||||
|
|
|
@ -421,10 +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_ChangeDeviceControl)
|
if (rep->RepType == X_ListDeviceProperties)
|
||||||
SRepXChangeDeviceControl(client, len,
|
|
||||||
(xChangeDeviceControlReply *) rep);
|
|
||||||
else if (rep->RepType == X_ListDeviceProperties)
|
|
||||||
SRepXListDeviceProperties(client, len,
|
SRepXListDeviceProperties(client, len,
|
||||||
(xListDevicePropertiesReply *) rep);
|
(xListDevicePropertiesReply *) rep);
|
||||||
else if (rep->RepType == X_GetDeviceProperty)
|
else if (rep->RepType == X_GetDeviceProperty)
|
||||||
|
|
Loading…
Reference in New Issue