summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2013-02-06 14:07:22 +0100
committerPeter Hutterer <peter.hutterer@who-t.net>2013-02-18 12:13:53 +1000
commite7b4b83679604919035d5aab544092aef5ea6034 (patch)
tree8d0c6cd63ce1882f6d1a20d5fa16768357d90214
parent29a0c87f4d235898a526758b34c2abfdb656cdf4 (diff)
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 https://bugzilla.gnome.org/show_bug.cgi?id=677329 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 <carlosg@gnome.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 509b3c3dc82e7abce1900d5e1cddd90f23be5a87)
-rw-r--r--dix/events.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/dix/events.c b/dix/events.c
index 904f0ba87..a43c99ac9 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -4561,6 +4561,7 @@ DeviceEnterLeaveEvent(DeviceIntPtr mouse,
{
GrabPtr grab = mouse->deviceGrab.grab;
xXIEnterEvent *event;
+ WindowPtr focus;
int filter;
int btlen, len, i;
DeviceIntPtr kbd;
@@ -4602,6 +4603,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);