XI: directly write out X_SetDeviceModifierMapping reply
Write out X_SetDeviceModifierMapping the 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
37c5d6bff2
commit
c37c82e3f2
|
@ -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_SetDeviceModifierMapping)
|
if (rep->RepType == X_GetDeviceButtonMapping)
|
||||||
SRepXSetDeviceModifierMapping(client, len,
|
|
||||||
(xSetDeviceModifierMappingReply *) rep);
|
|
||||||
else if (rep->RepType == X_GetDeviceButtonMapping)
|
|
||||||
SRepXGetDeviceButtonMapping(client, len,
|
SRepXGetDeviceButtonMapping(client, len,
|
||||||
(xGetDeviceButtonMappingReply *) rep);
|
(xGetDeviceButtonMappingReply *) rep);
|
||||||
else if (rep->RepType == X_SetDeviceButtonMapping)
|
else if (rep->RepType == X_SetDeviceButtonMapping)
|
||||||
|
|
32
Xi/setmmap.c
32
Xi/setmmap.c
|
@ -91,35 +91,19 @@ ProcXSetDeviceModifierMapping(ClientPtr client)
|
||||||
if (ret == Success)
|
if (ret == Success)
|
||||||
ret = MappingSuccess;
|
ret = MappingSuccess;
|
||||||
|
|
||||||
|
if (ret != MappingSuccess && ret != MappingBusy && ret != MappingFailed)
|
||||||
|
return ret;
|
||||||
|
|
||||||
xSetDeviceModifierMappingReply rep = {
|
xSetDeviceModifierMappingReply rep = {
|
||||||
.repType = X_Reply,
|
.repType = X_Reply,
|
||||||
.RepType = X_SetDeviceModifierMapping,
|
.RepType = X_SetDeviceModifierMapping,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = 0
|
.success = ret,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (ret == MappingSuccess || ret == MappingBusy || ret == MappingFailed) {
|
if (client->swapped) {
|
||||||
rep.success = ret;
|
swaps(&rep.sequenceNumber);
|
||||||
WriteReplyToClient(client, sizeof(xSetDeviceModifierMappingReply),
|
|
||||||
&rep);
|
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
|
WriteToClient(client, sizeof(xSetDeviceModifierMappingReply), &rep);
|
||||||
return ret;
|
return Success;
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
*
|
|
||||||
* This procedure writes the reply for the XSetDeviceModifierMapping function,
|
|
||||||
* if the client and server have a different byte ordering.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SRepXSetDeviceModifierMapping(ClientPtr client, int size,
|
|
||||||
xSetDeviceModifierMappingReply * 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 ProcXSetDeviceModifierMapping(ClientPtr /* client */
|
int ProcXSetDeviceModifierMapping(ClientPtr /* client */
|
||||||
);
|
);
|
||||||
|
|
||||||
void SRepXSetDeviceModifierMapping(ClientPtr /* client */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xSetDeviceModifierMappingReply * /* rep */
|
|
||||||
);
|
|
||||||
|
|
||||||
#endif /* SETMMAP_H */
|
#endif /* SETMMAP_H */
|
||||||
|
|
Loading…
Reference in New Issue