diff --git a/Xi/extinit.c b/Xi/extinit.c index 7c83d9104e..37005c4b26 100644 --- a/Xi/extinit.c +++ b/Xi/extinit.c @@ -384,7 +384,7 @@ SProcIDispatch(ClientPtr client) case X_UngrabDeviceKey: return SProcXUngrabDeviceKey(client); case X_GrabDeviceButton: - return SProcXGrabDeviceButton(client); + return ProcXGrabDeviceButton(client); case X_UngrabDeviceButton: return SProcXUngrabDeviceButton(client); case X_AllowDeviceEvents: diff --git a/Xi/grabdevb.c b/Xi/grabdevb.c index cfbfcf5ac8..db2d97f868 100644 --- a/Xi/grabdevb.c +++ b/Xi/grabdevb.c @@ -64,27 +64,6 @@ SOFTWARE. #include "xace.h" #include "grabdev.h" -/*********************************************************************** - * - * Handle requests from clients with a different byte order. - * - */ - -int _X_COLD -SProcXGrabDeviceButton(ClientPtr client) -{ - REQUEST(xGrabDeviceButtonReq); - REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq); - swapl(&stuff->grabWindow); - swaps(&stuff->modifiers); - swaps(&stuff->event_count); - REQUEST_FIXED_SIZE(xGrabDeviceButtonReq, - stuff->event_count * sizeof(CARD32)); - SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count); - - return (ProcXGrabDeviceButton(client)); -} - /*********************************************************************** * * Grab a button on an extension device. @@ -94,6 +73,21 @@ SProcXGrabDeviceButton(ClientPtr client) int ProcXGrabDeviceButton(ClientPtr client) { + REQUEST(xGrabDeviceButtonReq); + REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq); + + if (client->swapped) { + swapl(&stuff->grabWindow); + swaps(&stuff->modifiers); + swaps(&stuff->event_count); + } + + REQUEST_FIXED_SIZE(xGrabDeviceButtonReq, + stuff->event_count * sizeof(CARD32)); + + if (client->swapped) + SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count); + int ret; DeviceIntPtr dev; DeviceIntPtr mdev; @@ -101,9 +95,6 @@ ProcXGrabDeviceButton(ClientPtr client) struct tmask tmp[EMASKSIZE]; GrabMask mask; - REQUEST(xGrabDeviceButtonReq); - REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq); - if (client->req_len != bytes_to_int32(sizeof(xGrabDeviceButtonReq)) + stuff->event_count) return BadLength; diff --git a/Xi/handlers.h b/Xi/handlers.h index 53d24a8308..30a3a023cd 100644 --- a/Xi/handlers.h +++ b/Xi/handlers.h @@ -73,7 +73,6 @@ int SProcXGetDeviceDontPropagateList(ClientPtr client); int SProcXGetDeviceMotionEvents(ClientPtr client); int SProcXGetExtensionVersion(ClientPtr client); int SProcXGetSelectedExtensionEvents(ClientPtr client); -int SProcXGrabDeviceButton(ClientPtr client); int SProcXIAllowEvents(ClientPtr client); int SProcXIBarrierReleasePointer(ClientPtr client); int SProcXIGetClientPointer(ClientPtr client);