Commit c67f2eac authored by Samuel Thibault's avatar Samuel Thibault Committed by Adam Jackson
Browse files

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
Signed-off-by: Samuel Thibault's avatarSamuel Thibault <>
Reviewed-by: Peter Hutterer's avatarPeter Hutterer <>
parent 14be894b
......@@ -1562,7 +1562,7 @@ DoFocusEvents(DeviceIntPtr pDev, WindowPtr from, WindowPtr to, int mode)
if (!IsKeyboardDevice(pDev))
if (from == to)
if (from == to && mode != NotifyGrab && mode != NotifyUngrab)
CoreFocusEvents(pDev, from, to, mode);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment