summaryrefslogtreecommitdiff
path: root/xserver
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2020-04-14 17:29:22 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2020-04-14 17:29:22 +0000
commit651e70633845bd4eff37fdcaef8b969028be002d (patch)
tree90ee2f4818312e0cf657717571e54a680a0208fb /xserver
parent0bb2d02863c5d564db137ae1c956d33a83286df2 (diff)
dix: do not send focus event when grab actually does not change
upstream commit 364d64981549544213e2bca8de6ff8a5b2b5a69e Fixes an issue in xserver 1.20 where some applications were loosing focus. Naddy@ reported it appeards in SDL 1.2 games (burgerspace). tested and ok naddy@
Diffstat (limited to 'xserver')
-rw-r--r--xserver/dix/events.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/xserver/dix/events.c b/xserver/dix/events.c
index c02a0594a..427b891ae 100644
--- a/xserver/dix/events.c
+++ b/xserver/dix/events.c
@@ -1532,7 +1532,9 @@ ActivatePointerGrab(DeviceIntPtr mouse, GrabPtr grab,
mouse->spriteInfo->sprite->hotPhys.y = 0;
ConfineCursorToWindow(mouse, grab->confineTo, FALSE, TRUE);
}
- DoEnterLeaveEvents(mouse, mouse->id, oldWin, grab->window, NotifyGrab);
+ if (! (grabinfo->grab && oldWin == grabinfo->grab->window
+ && oldWin == grab->window))
+ DoEnterLeaveEvents(mouse, mouse->id, oldWin, grab->window, NotifyGrab);
mouse->valuator->motionHintWindow = NullWindow;
if (syncEvents.playingEvents)
grabinfo->grabTime = syncEvents.time;
@@ -1642,7 +1644,9 @@ ActivateKeyboardGrab(DeviceIntPtr keybd, GrabPtr grab, TimeStamp time,
oldWin = keybd->focus->win;
if (keybd->valuator)
keybd->valuator->motionHintWindow = NullWindow;
- if (oldWin)
+ if (oldWin &&
+ ! (grabinfo->grab && oldWin == grabinfo->grab->window
+ && oldWin == grab->window))
DoFocusEvents(keybd, oldWin, grab->window, NotifyGrab);
if (syncEvents.playingEvents)
grabinfo->grabTime = syncEvents.time;