diff options
| author | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-04-25 16:28:58 +0930 |
|---|---|---|
| committer | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-04-25 16:28:58 +0930 |
| commit | 1d0438de176551aaeff549664f00b8bd83d465af (patch) | |
| tree | e2ff101de9ed4fe780f83aa9d71ab82650690e52 | |
| parent | be5ff2b8d8a392eb8611e1fcd6da4752d68a7f9d (diff) | |
Xi: remove RemoveOtherCoreGrabs()
PickPointer() returns grabbed devices, so we can't get a double grab anyway.
| -rw-r--r-- | dix/events.c | 47 | ||||
| -rw-r--r-- | include/dix.h | 4 |
2 files changed, 0 insertions, 51 deletions
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; @@ -5345,47 +5342,6 @@ GrabDevice(ClientPtr client, DeviceIntPtr dev, } /** - * 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. * * Grabs the client's keyboard and returns success status to client. @@ -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 */, |
