XI: directly write out X_GetFeedbackControl reply
Write out X_GetFeedbackControl 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
dc950a7d52
commit
e226b1396a
|
@ -421,9 +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_GetFeedbackControl)
|
if (rep->RepType == X_GetDeviceKeyMapping)
|
||||||
SRepXGetFeedbackControl(client, len, (xGetFeedbackControlReply *) rep);
|
|
||||||
else if (rep->RepType == X_GetDeviceKeyMapping)
|
|
||||||
SRepXGetDeviceKeyMapping(client, len,
|
SRepXGetDeviceKeyMapping(client, len,
|
||||||
(xGetDeviceKeyMappingReply *) rep);
|
(xGetDeviceKeyMappingReply *) rep);
|
||||||
else if (rep->RepType == X_GetDeviceModifierMapping)
|
else if (rep->RepType == X_GetDeviceModifierMapping)
|
||||||
|
|
26
Xi/getfctl.c
26
Xi/getfctl.c
|
@ -234,23 +234,6 @@ CopySwapBellFeedback(ClientPtr client, BellFeedbackPtr b, char **buf)
|
||||||
*buf += sizeof(xBellFeedbackState);
|
*buf += sizeof(xBellFeedbackState);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
*
|
|
||||||
* This procedure writes the reply for the xGetFeedbackControl function,
|
|
||||||
* if the client and server have a different byte ordering.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SRepXGetFeedbackControl(ClientPtr client, int size,
|
|
||||||
xGetFeedbackControlReply * rep)
|
|
||||||
{
|
|
||||||
swaps(&rep->sequenceNumber);
|
|
||||||
swapl(&rep->length);
|
|
||||||
swaps(&rep->num_feedbacks);
|
|
||||||
WriteToClient(client, size, rep);
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
*
|
*
|
||||||
* Get the feedback control state.
|
* Get the feedback control state.
|
||||||
|
@ -281,7 +264,6 @@ ProcXGetFeedbackControl(ClientPtr client)
|
||||||
.repType = X_Reply,
|
.repType = X_Reply,
|
||||||
.RepType = X_GetFeedbackControl,
|
.RepType = X_GetFeedbackControl,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = 0,
|
|
||||||
.num_feedbacks = 0
|
.num_feedbacks = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -333,7 +315,13 @@ ProcXGetFeedbackControl(ClientPtr client)
|
||||||
CopySwapBellFeedback(client, b, &buf);
|
CopySwapBellFeedback(client, b, &buf);
|
||||||
|
|
||||||
rep.length = bytes_to_int32(total_length);
|
rep.length = bytes_to_int32(total_length);
|
||||||
WriteReplyToClient(client, sizeof(xGetFeedbackControlReply), &rep);
|
|
||||||
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swapl(&rep.length);
|
||||||
|
swaps(&rep.num_feedbacks);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(xGetFeedbackControlReply), &rep);
|
||||||
WriteToClient(client, total_length, savbuf);
|
WriteToClient(client, total_length, savbuf);
|
||||||
free(savbuf);
|
free(savbuf);
|
||||||
return Success;
|
return Success;
|
||||||
|
|
|
@ -33,9 +33,4 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
int ProcXGetFeedbackControl(ClientPtr /* client */
|
int ProcXGetFeedbackControl(ClientPtr /* client */
|
||||||
);
|
);
|
||||||
|
|
||||||
void SRepXGetFeedbackControl(ClientPtr /* client */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xGetFeedbackControlReply * /* rep */
|
|
||||||
);
|
|
||||||
|
|
||||||
#endif /* GETFCTL_H */
|
#endif /* GETFCTL_H */
|
||||||
|
|
Loading…
Reference in New Issue