mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
XI: directly write out X_XIPassiveGrabDevice reply
Write out the X_XIPassiveGrabDevice 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:
committed by
Enrico Weigelt, metux IT consult .
parent
ba442c33b9
commit
c3c53c79b1
@@ -422,9 +422,7 @@ SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep)
|
||||
{
|
||||
/* All we look at is the type field */
|
||||
/* This is common to all replies */
|
||||
if (rep->RepType == X_XIPassiveGrabDevice)
|
||||
SRepXIPassiveGrabDevice(client, len, (xXIPassiveGrabDeviceReply *) rep);
|
||||
else if (rep->RepType == X_XIListProperties)
|
||||
if (rep->RepType == X_XIListProperties)
|
||||
SRepXIListProperties(client, len, (xXIListPropertiesReply *) rep);
|
||||
else if (rep->RepType == X_XIGetProperty)
|
||||
SRepXIGetProperty(client, len, (xXIGetPropertyReply *) rep);
|
||||
|
||||
@@ -92,7 +92,6 @@ ProcXIPassiveGrabDevice(ClientPtr client)
|
||||
GrabParameters param;
|
||||
void *tmp;
|
||||
int mask_len;
|
||||
uint32_t length;
|
||||
|
||||
REQUEST(xXIPassiveGrabDeviceReq);
|
||||
REQUEST_FIXED_SIZE(xXIPassiveGrabDeviceReq,
|
||||
@@ -247,11 +246,15 @@ ProcXIPassiveGrabDevice(ClientPtr client)
|
||||
}
|
||||
}
|
||||
|
||||
/* save the value before SRepXIPassiveGrabDevice swaps it */
|
||||
length = rep.length;
|
||||
WriteReplyToClient(client, sizeof(rep), &rep);
|
||||
if (rep.num_modifiers)
|
||||
WriteToClient(client, length * 4, modifiers_failed);
|
||||
uint32_t length = rep.length; /* save it before swapping */
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swaps(&rep.num_modifiers);
|
||||
}
|
||||
WriteToClient(client, sizeof(rep), &rep);
|
||||
WriteToClient(client, length * 4, modifiers_failed);
|
||||
|
||||
out:
|
||||
free(modifiers_failed);
|
||||
@@ -259,17 +262,6 @@ ProcXIPassiveGrabDevice(ClientPtr client)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void _X_COLD
|
||||
SRepXIPassiveGrabDevice(ClientPtr client, int size,
|
||||
xXIPassiveGrabDeviceReply * rep)
|
||||
{
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
swaps(&rep->num_modifiers);
|
||||
|
||||
WriteToClient(client, size, rep);
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXIPassiveUngrabDevice(ClientPtr client)
|
||||
{
|
||||
|
||||
@@ -32,8 +32,6 @@
|
||||
|
||||
int SProcXIPassiveUngrabDevice(ClientPtr client);
|
||||
int ProcXIPassiveUngrabDevice(ClientPtr client);
|
||||
void SRepXIPassiveGrabDevice(ClientPtr client, int size,
|
||||
xXIPassiveGrabDeviceReply * rep);
|
||||
int ProcXIPassiveGrabDevice(ClientPtr client);
|
||||
int SProcXIPassiveGrabDevice(ClientPtr client);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user