diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-06-01 17:14:06 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-06-02 16:02:29 +1000 |
commit | 1cd7ed75d903b5b0ea4e1070d2c26f4f931bdec7 (patch) | |
tree | f0a32d7f8f96ee8ca4e213568a158c9aa81e900f | |
parent | f56ad22e8fabdca6d9fd1e408a539696e30599fc (diff) |
dix: float slave devices during passive grabs.
Exception - implicit passive grabs.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | dix/events.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/dix/events.c b/dix/events.c index cf9ee6002..52c5e6c38 100644 --- a/dix/events.c +++ b/dix/events.c @@ -1506,7 +1506,7 @@ ActivatePointerGrab(DeviceIntPtr mouse, GrabPtr grab, Bool isPassive = autoGrab & ~ImplicitGrabMask; /* slave devices need to float for the duration of the grab. */ - if (!isPassive && !IsMaster(mouse)) + if (!(autoGrab & ImplicitGrabMask) && !IsMaster(mouse)) DetachFromMaster(mouse); if (grab->confineTo) @@ -1543,7 +1543,8 @@ DeactivatePointerGrab(DeviceIntPtr mouse) { GrabPtr grab = mouse->deviceGrab.grab; DeviceIntPtr dev; - Bool wasPassive= mouse->deviceGrab.fromPassiveGrab; + Bool wasImplicit = (mouse->deviceGrab.fromPassiveGrab && + mouse->deviceGrab.implicitGrab); mouse->valuator->motionHintWindow = NullWindow; mouse->deviceGrab.grab = NullGrab; @@ -1563,7 +1564,7 @@ DeactivatePointerGrab(DeviceIntPtr mouse) if (grab->cursor) FreeCursor(grab->cursor, (Cursor)0); - if (!wasPassive) + if (!wasImplicit) ReattachToOldMaster(mouse); ComputeFreezes(); @@ -1581,7 +1582,7 @@ ActivateKeyboardGrab(DeviceIntPtr keybd, GrabPtr grab, TimeStamp time, Bool pass WindowPtr oldWin; /* slave devices need to float for the duration of the grab. */ - if (!passive && !IsMaster(keybd)) + if (!(passive & ImplicitGrabMask) && !IsMaster(keybd)) DetachFromMaster(keybd); if (grabinfo->grab) @@ -1616,7 +1617,8 @@ DeactivateKeyboardGrab(DeviceIntPtr keybd) DeviceIntPtr dev; WindowPtr focusWin = keybd->focus ? keybd->focus->win : keybd->spriteInfo->sprite->win; - Bool wasPassive = keybd->deviceGrab.fromPassiveGrab; + Bool wasImplicit = (keybd->deviceGrab.fromPassiveGrab && + keybd->deviceGrab.implicitGrab); if (focusWin == FollowKeyboardWin) focusWin = inputInfo.keyboard->focus->win; @@ -1633,7 +1635,7 @@ DeactivateKeyboardGrab(DeviceIntPtr keybd) } DoFocusEvents(keybd, grab->window, focusWin, NotifyUngrab); - if (!wasPassive) + if (!wasImplicit) ReattachToOldMaster(keybd); ComputeFreezes(); |