dix: write out X_GetSelectionOwner reply directly
No need for using a complex callback machinery, if we just move the little pieces of byte-swapping directly into the request handler. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
0812c4953a
commit
361a8ef46f
|
@ -219,7 +219,6 @@ ProcGetSelectionOwner(ClientPtr client)
|
|||
{
|
||||
int rc;
|
||||
Selection *pSel;
|
||||
xGetSelectionOwnerReply reply;
|
||||
|
||||
REQUEST(xResourceReq);
|
||||
REQUEST_SIZE_MATCH(xResourceReq);
|
||||
|
@ -229,7 +228,7 @@ ProcGetSelectionOwner(ClientPtr client)
|
|||
return BadAtom;
|
||||
}
|
||||
|
||||
reply = (xGetSelectionOwnerReply) {
|
||||
xGetSelectionOwnerReply rep = {
|
||||
.type = X_Reply,
|
||||
.sequenceNumber = client->sequence,
|
||||
.length = 0,
|
||||
|
@ -237,13 +236,18 @@ ProcGetSelectionOwner(ClientPtr client)
|
|||
|
||||
rc = dixLookupSelection(&pSel, stuff->id, client, DixGetAttrAccess);
|
||||
if (rc == Success)
|
||||
reply.owner = pSel->window;
|
||||
rep.owner = pSel->window;
|
||||
else if (rc == BadMatch)
|
||||
reply.owner = None;
|
||||
rep.owner = None;
|
||||
else
|
||||
return rc;
|
||||
|
||||
WriteReplyToClient(client, sizeof(xGetSelectionOwnerReply), &reply);
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.owner);
|
||||
}
|
||||
|
||||
WriteToClient(client, sizeof(rep), &rep);
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
|
|
@ -249,15 +249,6 @@ SListPropertiesReply(ClientPtr pClient, int size, xListPropertiesReply * pRep)
|
|||
WriteToClient(pClient, size, pRep);
|
||||
}
|
||||
|
||||
void _X_COLD
|
||||
SGetSelectionOwnerReply(ClientPtr pClient, int size,
|
||||
xGetSelectionOwnerReply * pRep)
|
||||
{
|
||||
swaps(&pRep->sequenceNumber);
|
||||
swapl(&pRep->owner);
|
||||
WriteToClient(pClient, size, pRep);
|
||||
}
|
||||
|
||||
void _X_COLD
|
||||
SQueryPointerReply(ClientPtr pClient, int size, xQueryPointerReply * pRep)
|
||||
{
|
||||
|
|
|
@ -738,7 +738,7 @@ ReplySwapPtr ReplySwapVector[256] = {
|
|||
(ReplySwapPtr) SGetPropertyReply, /* 20 */
|
||||
(ReplySwapPtr) SListPropertiesReply,
|
||||
ReplyNotSwappd,
|
||||
(ReplySwapPtr) SGetSelectionOwnerReply,
|
||||
ReplyNotSwappd,
|
||||
ReplyNotSwappd,
|
||||
ReplyNotSwappd, /* 25 */
|
||||
(ReplySwapPtr) SGenericReply, /* SGrabPointerReply, */
|
||||
|
|
|
@ -67,11 +67,6 @@ extern void SListPropertiesReply(ClientPtr /* pClient */ ,
|
|||
int /* size */ ,
|
||||
xListPropertiesReply * /* pRep */ );
|
||||
|
||||
extern void SGetSelectionOwnerReply(ClientPtr /* pClient */ ,
|
||||
int /* size */ ,
|
||||
xGetSelectionOwnerReply *
|
||||
/* pRep */ );
|
||||
|
||||
extern void SQueryPointerReply(ClientPtr /* pClient */ ,
|
||||
int /* size */ ,
|
||||
xQueryPointerReply * /* pRep */ );
|
||||
|
|
Loading…
Reference in New Issue