aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix/events.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/dix/events.c')
-rw-r--r--xorg-server/dix/events.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/xorg-server/dix/events.c b/xorg-server/dix/events.c
index dd9dce7bb..4f9a762bb 100644
--- a/xorg-server/dix/events.c
+++ b/xorg-server/dix/events.c
@@ -1596,13 +1596,10 @@ DeactivateKeyboardGrab(DeviceIntPtr keybd)
{
GrabPtr grab = keybd->deviceGrab.grab;
DeviceIntPtr dev;
- WindowPtr focusWin = keybd->focus ? keybd->focus->win
- : keybd->spriteInfo->sprite->win;
+ WindowPtr focusWin;
Bool wasImplicit = (keybd->deviceGrab.fromPassiveGrab &&
keybd->deviceGrab.implicitGrab);
- if (focusWin == FollowKeyboardWin)
- focusWin = inputInfo.keyboard->focus->win;
if (keybd->valuator)
keybd->valuator->motionHintWindow = NullWindow;
keybd->deviceGrab.grab = NullGrab;
@@ -1613,6 +1610,17 @@ DeactivateKeyboardGrab(DeviceIntPtr keybd)
if (dev->deviceGrab.sync.other == grab)
dev->deviceGrab.sync.other = NullGrab;
}
+
+ if (keybd->focus)
+ focusWin = keybd->focus->win;
+ else if (keybd->spriteInfo->sprite)
+ focusWin = keybd->spriteInfo->sprite->win;
+ else
+ focusWin = NullWindow;
+
+ if (focusWin == FollowKeyboardWin)
+ focusWin = inputInfo.keyboard->focus->win;
+
DoFocusEvents(keybd, grab->window, focusWin, NotifyUngrab);
if (!wasImplicit && grab->grabtype == XI2)