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 */