dix: send focus events to the immediate parent (#44079)

For a transition from windows A to B, A->parent did not receive an event.
DeviceFocusOutEvents sends to windows ]from, to[, so start with the actual
window, not it's parent.

X.Org Bug 44079 <http://bugs.freedesktop.org/show_bug.cgi?id=44079>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Peter Hutterer 2012-01-05 07:02:51 -05:00
parent 75953ccb9e
commit a125aabda3

View File

@ -1292,7 +1292,7 @@ DeviceFocusEvents(DeviceIntPtr dev,
NotifyPointer); NotifyPointer);
DeviceFocusEvent(dev, XI_FocusOut, mode, NotifyNonlinear, from); DeviceFocusEvent(dev, XI_FocusOut, mode, NotifyNonlinear, from);
/* next call catches the root too, if the screen changed */ /* next call catches the root too, if the screen changed */
DeviceFocusOutEvents(dev, from->parent, NullWindow, mode, DeviceFocusOutEvents(dev, from, NullWindow, mode,
NotifyNonlinearVirtual); NotifyNonlinearVirtual);
} }
/* Notify all the roots */ /* Notify all the roots */
@ -1321,7 +1321,7 @@ DeviceFocusEvents(DeviceIntPtr dev,
if (IsParent(to, from)) if (IsParent(to, from))
{ {
DeviceFocusEvent(dev, XI_FocusOut, mode, NotifyAncestor, from); DeviceFocusEvent(dev, XI_FocusOut, mode, NotifyAncestor, from);
DeviceFocusOutEvents(dev, from->parent, to, mode, DeviceFocusOutEvents(dev, from, to, mode,
NotifyVirtual); NotifyVirtual);
DeviceFocusEvent(dev, XI_FocusIn, mode, NotifyInferior, to); DeviceFocusEvent(dev, XI_FocusIn, mode, NotifyInferior, to);
if ((IsParent(to, sprite->win)) && if ((IsParent(to, sprite->win)) &&
@ -1353,7 +1353,7 @@ DeviceFocusEvents(DeviceIntPtr dev,
NotifyPointer); NotifyPointer);
DeviceFocusEvent(dev, XI_FocusOut, mode, NotifyNonlinear, from); DeviceFocusEvent(dev, XI_FocusOut, mode, NotifyNonlinear, from);
if (from->parent != NullWindow) if (from->parent != NullWindow)
DeviceFocusOutEvents(dev, from->parent, common, mode, DeviceFocusOutEvents(dev, from, common, mode,
NotifyNonlinearVirtual); NotifyNonlinearVirtual);
if (to->parent != NullWindow) if (to->parent != NullWindow)
DeviceFocusInEvents(dev, common, to, mode, NotifyNonlinearVirtual); DeviceFocusInEvents(dev, common, to, mode, NotifyNonlinearVirtual);