XI: directly write out X_GetDeviceButtonMapping reply
Write out the X_GetDeviceButtonMapping 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
c37c82e3f2
commit
f43b2fdc87
|
@ -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_GetDeviceButtonMapping)
|
if (rep->RepType == X_SetDeviceButtonMapping)
|
||||||
SRepXGetDeviceButtonMapping(client, len,
|
|
||||||
(xGetDeviceButtonMappingReply *) rep);
|
|
||||||
else if (rep->RepType == X_SetDeviceButtonMapping)
|
|
||||||
SRepXSetDeviceButtonMapping(client, len,
|
SRepXSetDeviceButtonMapping(client, len,
|
||||||
(xSetDeviceButtonMappingReply *) rep);
|
(xSetDeviceButtonMappingReply *) rep);
|
||||||
else if (rep->RepType == X_QueryDeviceState)
|
else if (rep->RepType == X_QueryDeviceState)
|
||||||
|
|
22
Xi/getbmap.c
22
Xi/getbmap.c
|
@ -91,23 +91,11 @@ ProcXGetDeviceButtonMapping(ClientPtr client)
|
||||||
.length = bytes_to_int32(b->numButtons),
|
.length = bytes_to_int32(b->numButtons),
|
||||||
};
|
};
|
||||||
|
|
||||||
WriteReplyToClient(client, sizeof(xGetDeviceButtonMappingReply), &rep);
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swapl(&rep.length);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(xGetDeviceButtonMappingReply), &rep);
|
||||||
WriteToClient(client, rep.nElts, &b->map[1]);
|
WriteToClient(client, rep.nElts, &b->map[1]);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
*
|
|
||||||
* This procedure writes the reply for the XGetDeviceButtonMapping function,
|
|
||||||
* if the client and server have a different byte ordering.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SRepXGetDeviceButtonMapping(ClientPtr client, int size,
|
|
||||||
xGetDeviceButtonMappingReply * 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 ProcXGetDeviceButtonMapping(ClientPtr /* client */
|
int ProcXGetDeviceButtonMapping(ClientPtr /* client */
|
||||||
);
|
);
|
||||||
|
|
||||||
void SRepXGetDeviceButtonMapping(ClientPtr /* client */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xGetDeviceButtonMappingReply * /* rep */
|
|
||||||
);
|
|
||||||
|
|
||||||
#endif /* GETBMAP_H */
|
#endif /* GETBMAP_H */
|
||||||
|
|
Loading…
Reference in New Issue