From 1b3859a49a3861517c9b34f6e8750f7ae0ff2b5d Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 21 Aug 2009 12:29:39 +1000 Subject: [PATCH] Xi: add swapping hook for XIGetFocus reply. Signed-off-by: Peter Hutterer --- Xi/extinit.c | 2 ++ Xi/xisetdevfocus.c | 10 ++++++++++ Xi/xisetdevfocus.h | 1 + 3 files changed, 13 insertions(+) diff --git a/Xi/extinit.c b/Xi/extinit.c index e3590838a..d91de8f0e 100644 --- a/Xi/extinit.c +++ b/Xi/extinit.c @@ -525,6 +525,8 @@ SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep) SRepXIGetProperty(client, len, (xXIGetPropertyReply *) rep); else if (rep->RepType == X_XIGetSelectedEvents) SRepXIGetSelectedEvents(client, len, (xXIGetSelectedEventsReply *) rep); + else if (rep->RepType == X_XIGetFocus) + SRepXIGetFocus(client, len, (xXIGetFocusReply *) rep); else { FatalError("XINPUT confused sending swapped reply"); } diff --git a/Xi/xisetdevfocus.c b/Xi/xisetdevfocus.c index 32f7e597b..059424e41 100644 --- a/Xi/xisetdevfocus.c +++ b/Xi/xisetdevfocus.c @@ -118,3 +118,13 @@ ProcXIGetFocus(ClientPtr client) WriteReplyToClient(client, sizeof(xXIGetFocusReply), &rep); return Success; } + +void +SRepXIGetFocus(ClientPtr client, int len, xXIGetFocusReply *rep) +{ + char n; + swaps(&rep->sequenceNumber, n); + swapl(&rep->length, n); + swapl(&rep->focus, n); + WriteToClient(client, len, (char *)rep); +} diff --git a/Xi/xisetdevfocus.h b/Xi/xisetdevfocus.h index 5ec1fa2cf..eb584eb76 100644 --- a/Xi/xisetdevfocus.h +++ b/Xi/xisetdevfocus.h @@ -32,4 +32,5 @@ int ProcXISetFocus(ClientPtr client); int SProcXIGetFocus(ClientPtr client); int ProcXIGetFocus(ClientPtr client); +void SRepXIGetFocus(ClientPtr client, int len, xXIGetFocusReply* rep); #endif /* XISETDEVFOCUS_H */