diff --git a/dix/events.c b/dix/events.c index 42299a71ac..e024e75ebf 100644 --- a/dix/events.c +++ b/dix/events.c @@ -5696,9 +5696,18 @@ ProcGrabKey(ClientPtr client) int ProcGrabButton(ClientPtr client) { - WindowPtr pWin, confineTo; - REQUEST(xGrabButtonReq); + REQUEST_SIZE_MATCH(xGrabButtonReq); + + if (client->swapped) { + swapl(&stuff->grabWindow); + swaps(&stuff->eventMask); + swapl(&stuff->confineTo); + swapl(&stuff->cursor); + swaps(&stuff->modifiers); + } + + WindowPtr pWin, confineTo; CursorPtr cursor; GrabPtr grab; DeviceIntPtr ptr, modifierDevice; @@ -5707,7 +5716,6 @@ ProcGrabButton(ClientPtr client) GrabParameters param; int rc; - REQUEST_SIZE_MATCH(xGrabButtonReq); UpdateCurrentTime(); if ((stuff->pointerMode != GrabModeSync) && (stuff->pointerMode != GrabModeAsync)) { diff --git a/dix/reqhandlers_priv.h b/dix/reqhandlers_priv.h index bf947a6ffb..c556cc5c5b 100644 --- a/dix/reqhandlers_priv.h +++ b/dix/reqhandlers_priv.h @@ -51,8 +51,6 @@ XRetCode ProcWarpPointer(ClientPtr pClient) XRetCode SProcChangeActivePointerGrab(ClientPtr pClient) _X_ATTRIBUTE_NONNULL_ARG(1); -XRetCode SProcGrabButton(ClientPtr pClient) - _X_ATTRIBUTE_NONNULL_ARG(1); XRetCode SProcGrabKey(ClientPtr pClient) _X_ATTRIBUTE_NONNULL_ARG(1); XRetCode SProcGrabKeyboard(ClientPtr pClient) diff --git a/dix/swapreq.c b/dix/swapreq.c index 4844c3987a..6ad0cae11c 100644 --- a/dix/swapreq.c +++ b/dix/swapreq.c @@ -187,19 +187,6 @@ SProcSendEvent(ClientPtr client) return ((*ProcVector[X_SendEvent]) (client)); } -int _X_COLD -SProcGrabButton(ClientPtr client) -{ - REQUEST(xGrabButtonReq); - REQUEST_SIZE_MATCH(xGrabButtonReq); - swapl(&stuff->grabWindow); - swaps(&stuff->eventMask); - swapl(&stuff->confineTo); - swapl(&stuff->cursor); - swaps(&stuff->modifiers); - return ((*ProcVector[X_GrabButton]) (client)); -} - int _X_COLD SProcUngrabButton(ClientPtr client) { diff --git a/dix/tables.c b/dix/tables.c index 0bfc45ebb0..d1514e8684 100644 --- a/dix/tables.c +++ b/dix/tables.c @@ -360,7 +360,7 @@ int (*SwappedProcVector[256]) (ClientPtr /* client */) = { SProcSendEvent, /* 25 */ ProcGrabPointer, ProcUngrabPointer, - SProcGrabButton, + ProcGrabButton, SProcUngrabButton, SProcChangeActivePointerGrab, /* 30 */ SProcGrabKeyboard,