summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2011-02-22 13:43:28 +0000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-04-07 08:36:58 +1000
commite9ba0539de1c4dfb946e1885cd64b3fc45bc2dbe (patch)
tree05a9e538974ab53d69e3fe59a9af97b2b5b393a0
parentff066dc75b6b8eb3f957d00f57011197a588cec6 (diff)
Input: Don't freeze unrelated devices in DeliverGrabbedEvent
When delivering an event to a device grabbed with SyncBoth, DeliverGrabbedEvent walks the device tree looking for associated devices to freeze them. Unfortunately, it froze all devices instead of just the paired device, and the previous fix in 4fbadc8b17237f3c would still break if the same client had a non-SyncBoth grab on another unrelated master device. Fix this by completely ignoring devices that aren't our paired device. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit b636893137da1695e235e3a9354bfd9243fdddc2)
-rw-r--r--dix/events.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/dix/events.c b/dix/events.c
index 07f8b05ea..f0ea57626 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -3872,16 +3872,15 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev,
switch (grabinfo->sync.state)
{
case FREEZE_BOTH_NEXT_EVENT:
- for (dev = inputInfo.devices; dev; dev = dev->next)
+ dev = GetPairedDevice(thisDev);
+ if (dev)
{
- if (dev == thisDev)
- continue;
FreezeThaw(dev, TRUE);
if ((dev->deviceGrab.sync.state == FREEZE_BOTH_NEXT_EVENT) &&
(CLIENT_BITS(grab->resource) ==
CLIENT_BITS(dev->deviceGrab.grab->resource)))
dev->deviceGrab.sync.state = FROZEN_NO_EVENT;
- else if (GetPairedDevice(thisDev) == dev)
+ else
dev->deviceGrab.sync.other = grab;
}
/* fall through */