XI: directly write out X_SetDeviceButtonMapping reply
Write out the X_SetDeviceButtonMapping 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
f43b2fdc87
commit
13cc0cdf09
|
@ -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_SetDeviceButtonMapping)
|
if (rep->RepType == X_QueryDeviceState)
|
||||||
SRepXSetDeviceButtonMapping(client, len,
|
|
||||||
(xSetDeviceButtonMappingReply *) rep);
|
|
||||||
else if (rep->RepType == X_QueryDeviceState)
|
|
||||||
SRepXQueryDeviceState(client, len, (xQueryDeviceStateReply *) rep);
|
SRepXQueryDeviceState(client, len, (xQueryDeviceStateReply *) rep);
|
||||||
else if (rep->RepType == X_SetDeviceValuators)
|
else if (rep->RepType == X_SetDeviceValuators)
|
||||||
SRepXSetDeviceValuators(client, len, (xSetDeviceValuatorsReply *) rep);
|
SRepXSetDeviceValuators(client, len, (xSetDeviceValuatorsReply *) rep);
|
||||||
|
|
41
Xi/setbmap.c
41
Xi/setbmap.c
|
@ -85,41 +85,26 @@ ProcXSetDeviceButtonMapping(ClientPtr client)
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
xSetDeviceButtonMappingReply rep = {
|
|
||||||
.repType = X_Reply,
|
|
||||||
.RepType = X_SetDeviceButtonMapping,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
.status = MappingSuccess
|
|
||||||
};
|
|
||||||
|
|
||||||
ret =
|
ret =
|
||||||
ApplyPointerMapping(dev, (CARD8 *) &stuff[1], stuff->map_length,
|
ApplyPointerMapping(dev, (CARD8 *) &stuff[1], stuff->map_length,
|
||||||
client);
|
client);
|
||||||
if (ret == -1)
|
if (ret == -1)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
else if (ret == MappingBusy)
|
|
||||||
rep.status = ret;
|
if ((ret != Success) && (ret != MappingBusy))
|
||||||
else if (ret != Success)
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
WriteReplyToClient(client, sizeof(xSetDeviceButtonMappingReply), &rep);
|
xSetDeviceButtonMappingReply rep = {
|
||||||
|
.repType = X_Reply,
|
||||||
|
.RepType = X_SetDeviceButtonMapping,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.status = (ret == Success ? MappingSuccess : MappingBusy),
|
||||||
|
};
|
||||||
|
|
||||||
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(xSetDeviceButtonMappingReply), &rep);
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
*
|
|
||||||
* This procedure writes the reply for the XSetDeviceButtonMapping function,
|
|
||||||
* if the client and server have a different byte ordering.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SRepXSetDeviceButtonMapping(ClientPtr client, int size,
|
|
||||||
xSetDeviceButtonMappingReply * 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 ProcXSetDeviceButtonMapping(ClientPtr /* client */
|
int ProcXSetDeviceButtonMapping(ClientPtr /* client */
|
||||||
);
|
);
|
||||||
|
|
||||||
void SRepXSetDeviceButtonMapping(ClientPtr /* client */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xSetDeviceButtonMappingReply * /* rep */
|
|
||||||
);
|
|
||||||
|
|
||||||
#endif /* SETBMAP_H */
|
#endif /* SETBMAP_H */
|
||||||
|
|
Loading…
Reference in New Issue