diff --git a/dix/events.c b/dix/events.c index 779be813f..73b7fa0f2 100644 --- a/dix/events.c +++ b/dix/events.c @@ -5161,9 +5161,6 @@ ProcGrabPointer(ClientPtr client) if (oldCursor) FreeCursor (oldCursor, (Cursor)0); rep.status = GrabSuccess; - - /* guarantee only one core pointer grab at a time by this client */ - RemoveOtherCoreGrabs(client, device); } WriteReplyToClient(client, sizeof(xGrabPointerReply), &rep); return Success; @@ -5344,47 +5341,6 @@ GrabDevice(ClientPtr client, DeviceIntPtr dev, return Success; } -/** - * Deactivate any core grabs on the given client except the given device. - * - * This fixes race conditions where clients deal with implicit passive grabs - * on one device, but then actively grab their client pointer, which is - * another device. - * - * Grabs are only removed if the other device matches the type of device. If - * dev is a pointer device, only other pointer grabs are removed. Likewise, if - * dev is a keyboard device, only keyboard grabs are removed. - * - * If dev doesn't have a grab, do nothing and go for a beer. - * - * @param client The client that is to be limited. - * @param dev The only device allowed to have a grab on the client. - */ - -_X_EXPORT void -RemoveOtherCoreGrabs(ClientPtr client, DeviceIntPtr dev) -{ - if (!dev || !dev->deviceGrab.grab) - return; - - DeviceIntPtr it = inputInfo.devices; - for (; it; it = it->next) - { - if (it == dev) - continue; - /* check for IsPointer Device */ - - if (it->deviceGrab.grab && - it->deviceGrab.grab->coreGrab && - SameClient(it->deviceGrab.grab, client)) - { - if ((IsPointerDevice(dev) && IsPointerDevice(it)) || - (IsKeyboardDevice(dev) && IsKeyboardDevice(it))) - (*it->deviceGrab.DeactivateGrab)(it); - } - } -} - /** * Server-side protocol handling for GrabKeyboard request. * @@ -5405,9 +5361,6 @@ ProcGrabKeyboard(ClientPtr client) stuff->ownerEvents, stuff->time, KeyPressMask | KeyReleaseMask, &rep.status, TRUE); - /* ensure only one core keyboard grab by this client */ - RemoveOtherCoreGrabs(client, keyboard); - if (result != Success) return result; rep.type = X_Reply; diff --git a/include/dix.h b/include/dix.h index 57ffee9b9..970b1d880 100644 --- a/include/dix.h +++ b/include/dix.h @@ -460,10 +460,6 @@ extern int GrabDevice( CARD8 * /* status */, Bool /* coreGrab */); -extern void RemoveOtherCoreGrabs( - ClientPtr /* client */, - DeviceIntPtr /* dev */); - extern void InitEvents(void); extern void InitSprite( DeviceIntPtr /* pDev */,