From 4fbadc8b17237f3c7f8c0bf56003d1139c86655e Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Thu, 6 Jan 2011 11:32:26 +1000 Subject: [PATCH] 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 Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- dix/events.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dix/events.c b/dix/events.c index f280f9d7a..c1cce92d1 100644 --- a/dix/events.c +++ b/dix/events.c @@ -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 */