XI: directly write out X_XIQueryPointer reply
Write out the X_XIQueryPointer 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
3cded3300b
commit
f95fa10d6d
|
@ -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_XIQueryPointer)
|
if (rep->RepType == X_XIGetClientPointer)
|
||||||
SRepXIQueryPointer(client, len, (xXIQueryPointerReply *) rep);
|
|
||||||
else if (rep->RepType == X_XIGetClientPointer)
|
|
||||||
SRepXIGetClientPointer(client, len, (xXIGetClientPointerReply *) rep);
|
SRepXIGetClientPointer(client, len, (xXIGetClientPointerReply *) rep);
|
||||||
else if (rep->RepType == X_XIQueryVersion)
|
else if (rep->RepType == X_XIQueryVersion)
|
||||||
SRepXIQueryVersion(client, len, (xXIQueryVersionReply *) rep);
|
SRepXIQueryVersion(client, len, (xXIQueryVersionReply *) rep);
|
||||||
|
|
|
@ -195,34 +195,21 @@ ProcXIQueryPointer(ClientPtr client)
|
||||||
}
|
}
|
||||||
#endif /* XINERAMA */
|
#endif /* XINERAMA */
|
||||||
|
|
||||||
WriteReplyToClient(client, sizeof(xXIQueryPointerReply), &rep);
|
if (client->swapped) {
|
||||||
if (buttons)
|
swaps(&rep.sequenceNumber);
|
||||||
|
swapl(&rep.length);
|
||||||
|
swapl(&rep.root);
|
||||||
|
swapl(&rep.child);
|
||||||
|
swapl(&rep.root_x);
|
||||||
|
swapl(&rep.root_y);
|
||||||
|
swapl(&rep.win_x);
|
||||||
|
swapl(&rep.win_y);
|
||||||
|
swaps(&rep.buttons_len);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(xXIQueryPointerReply), &rep);
|
||||||
WriteToClient(client, buttons_size, buttons);
|
WriteToClient(client, buttons_size, buttons);
|
||||||
|
|
||||||
free(buttons);
|
free(buttons);
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
*
|
|
||||||
* This procedure writes the reply for the XIQueryPointer function,
|
|
||||||
* if the client and server have a different byte ordering.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
void
|
|
||||||
SRepXIQueryPointer(ClientPtr client, int size, xXIQueryPointerReply * rep)
|
|
||||||
{
|
|
||||||
swaps(&rep->sequenceNumber);
|
|
||||||
swapl(&rep->length);
|
|
||||||
swapl(&rep->root);
|
|
||||||
swapl(&rep->child);
|
|
||||||
swapl(&rep->root_x);
|
|
||||||
swapl(&rep->root_y);
|
|
||||||
swapl(&rep->win_x);
|
|
||||||
swapl(&rep->win_y);
|
|
||||||
swaps(&rep->buttons_len);
|
|
||||||
|
|
||||||
WriteToClient(client, size, rep);
|
|
||||||
}
|
|
||||||
|
|
|
@ -32,8 +32,5 @@
|
||||||
|
|
||||||
int SProcXIQueryPointer(ClientPtr /* client */ );
|
int SProcXIQueryPointer(ClientPtr /* client */ );
|
||||||
int ProcXIQueryPointer(ClientPtr /* client */ );
|
int ProcXIQueryPointer(ClientPtr /* client */ );
|
||||||
void SRepXIQueryPointer(ClientPtr /* client */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xXIQueryPointerReply * /* rep */ );
|
|
||||||
|
|
||||||
#endif /* QUERYDP_H */
|
#endif /* QUERYDP_H */
|
||||||
|
|
Loading…
Reference in New Issue