Commit 509b3c3d authored by Carlos Garnacho's avatar Carlos Garnacho Committed by Peter Hutterer
Browse files

dix: Set focus field on XI2 crossing events

Set on DeviceEnterLeaveEvent() the xXIEnterEvent->focus field
similarly to how the CoreEnterLeaveEvent() function above does
for core events.

This fixes bug

reported to GTK+, where focus handling on window managers with
sloppy focus or no window manager present was broken due to this
field being always set to FALSE.
Signed-off-by: Carlos Garnacho's avatarCarlos Garnacho <>
Reviewed-by: Peter Hutterer's avatarPeter Hutterer <>
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <>
parent 3e4be403
......@@ -4569,6 +4569,7 @@ DeviceEnterLeaveEvent(DeviceIntPtr mouse,
GrabPtr grab = mouse->deviceGrab.grab;
xXIEnterEvent *event;
WindowPtr focus;
int filter;
int btlen, len, i;
DeviceIntPtr kbd;
......@@ -4610,6 +4611,11 @@ DeviceEnterLeaveEvent(DeviceIntPtr mouse,
event->group.locked_group = kbd->key->xkbInfo->state.locked_group;
focus = (kbd) ? kbd->focus->win : None;
if ((focus != NoneWin) &&
((pWin == focus) || (focus == PointerRootWin) || IsParent(focus, pWin)))
event->focus = TRUE;
FixUpEventFromWindow(mouse->spriteInfo->sprite, (xEvent *) event, pWin,
None, FALSE);
Markdown is supported
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