summaryrefslogtreecommitdiff
path: root/dix/enterleave.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2018-04-09 14:35:30 +0200
committerAdam Jackson <ajax@redhat.com>2018-04-10 14:50:08 -0400
commitc67f2eac56518163981af59f5accb7c79bc00f6a (patch)
treed3bb0355f2c4033da8f40500923f2ef17d34e279 /dix/enterleave.c
parent14be894b3f7976c133fc186e0e3c475606bab241 (diff)
dix: always send focus event on grab change
Focus events are useless when 'from' and 'to' are the same. But when this is the result of a (Un)GrabKeyboard request, we should always send them, including when the window manager had previously used XSetInputFocus to specify the focus on a window which happens to be now taking a grab. This is notably needed for window manager using XI to always get keyboard events even during grabs, so they can determine exactly when grabbing is active. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'dix/enterleave.c')
-rw-r--r--dix/enterleave.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/dix/enterleave.c b/dix/enterleave.c
index 1b341f2de..a2f625bc9 100644
--- a/dix/enterleave.c
+++ b/dix/enterleave.c
@@ -1562,7 +1562,7 @@ DoFocusEvents(DeviceIntPtr pDev, WindowPtr from, WindowPtr to, int mode)
if (!IsKeyboardDevice(pDev))
return;
- if (from == to)
+ if (from == to && mode != NotifyGrab && mode != NotifyUngrab)
return;
CoreFocusEvents(pDev, from, to, mode);