Input: Prevent MD grabs from wandering on to other MDs

The code to set sync.other in DeliverGrabbedEvents is supposed to reset
sync.other for a paired MD to the grab under consideration, but was
rather optimistic in resetting sync.other for _all_ devices.

This would fall apart given two sets of MDs (A paired with B, Y paired
with Z), where both MDs were in FREEZE_BOTH_NEXT_EVENT due to being
called with SyncBoth, where no event had yet triggered the grab.  An
event being processed on MD A would result in B, Y and Z all having
sync.other set to A's grab, rather than just B.

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>
This commit is contained in:
Daniel Stone 2011-01-06 11:32:26 +10:00 committed by Peter Hutterer
parent f3480286ae
commit 4fbadc8b17

View File

@ -3889,7 +3889,7 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev,
(CLIENT_BITS(grab->resource) ==
CLIENT_BITS(dev->deviceGrab.grab->resource)))
dev->deviceGrab.sync.state = FROZEN_NO_EVENT;
else
else if (GetPairedDevice(thisDev) == dev)
dev->deviceGrab.sync.other = grab;
}
/* fall through */