From 3abbd327f4a732408119de1f8e9ecba4812772a5 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 5 Aug 2009 15:47:46 +1000 Subject: dix: detach SD during XI2 grabs only. XI1 grabs on slave devices leave the device attached - just like in earlier versions of XI. Tested-by: Thomas Jaeger Signed-off-by: Peter Hutterer --- dix/events.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'dix') diff --git a/dix/events.c b/dix/events.c index 916a6da1c..ec6aff7d6 100644 --- a/dix/events.c +++ b/dix/events.c @@ -1515,7 +1515,8 @@ ActivatePointerGrab(DeviceIntPtr mouse, GrabPtr grab, Bool isPassive = autoGrab & ~ImplicitGrabMask; /* slave devices need to float for the duration of the grab. */ - if (!(autoGrab & ImplicitGrabMask) && !IsMaster(mouse)) + if (grab->grabtype == GRABTYPE_XI2 && + !(autoGrab & ImplicitGrabMask) && !IsMaster(mouse)) DetachFromMaster(mouse); if (grab->confineTo) @@ -1573,7 +1574,7 @@ DeactivatePointerGrab(DeviceIntPtr mouse) if (grab->cursor) FreeCursor(grab->cursor, (Cursor)0); - if (!wasImplicit) + if (!wasImplicit && grab->grabtype == GRABTYPE_XI2) ReattachToOldMaster(mouse); ComputeFreezes(); @@ -1591,7 +1592,9 @@ ActivateKeyboardGrab(DeviceIntPtr keybd, GrabPtr grab, TimeStamp time, Bool pass WindowPtr oldWin; /* slave devices need to float for the duration of the grab. */ - if (!(passive & ImplicitGrabMask) && !IsMaster(keybd)) + if (grab->grabtype == GRABTYPE_XI2 && + !(passive & ImplicitGrabMask) && + !IsMaster(keybd)) DetachFromMaster(keybd); if (grabinfo->grab) @@ -1644,7 +1647,7 @@ DeactivateKeyboardGrab(DeviceIntPtr keybd) } DoFocusEvents(keybd, grab->window, focusWin, NotifyUngrab); - if (!wasImplicit) + if (!wasImplicit && grab->grabtype == GRABTYPE_XI2) ReattachToOldMaster(keybd); ComputeFreezes(); -- cgit v1.2.3