[PATCH v2 1/2] dix: send focus events to the immediate parent (#44079)

Peter Hutterer peter.hutterer at who-t.net
Wed Jan 4 21:49:19 PST 2012


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 at who-t.net>
---
Changes to v1:
- now covers all three occurences of this issue

 dix/enterleave.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/dix/enterleave.c b/dix/enterleave.c
index a39e640..2b8c7c5 100644
--- a/dix/enterleave.c
+++ b/dix/enterleave.c
@@ -1292,7 +1292,7 @@ DeviceFocusEvents(DeviceIntPtr dev,
                         NotifyPointer);
             DeviceFocusEvent(dev, XI_FocusOut, mode, NotifyNonlinear, from);
             /* next call catches the root too, if the screen changed */
-            DeviceFocusOutEvents(dev, from->parent, NullWindow, mode,
+            DeviceFocusOutEvents(dev, from, NullWindow, mode,
                     NotifyNonlinearVirtual);
         }
         /* Notify all the roots */
@@ -1321,7 +1321,7 @@ DeviceFocusEvents(DeviceIntPtr dev,
             if (IsParent(to, from))
             {
                 DeviceFocusEvent(dev, XI_FocusOut, mode, NotifyAncestor, from);
-                DeviceFocusOutEvents(dev, from->parent, to, mode,
+                DeviceFocusOutEvents(dev, from, to, mode,
                         NotifyVirtual);
                 DeviceFocusEvent(dev, XI_FocusIn, mode, NotifyInferior, to);
                 if ((IsParent(to, sprite->win)) &&
@@ -1353,7 +1353,7 @@ DeviceFocusEvents(DeviceIntPtr dev,
                                 NotifyPointer);
                     DeviceFocusEvent(dev, XI_FocusOut, mode, NotifyNonlinear, from);
                     if (from->parent != NullWindow)
-                        DeviceFocusOutEvents(dev, from->parent, common, mode,
+                        DeviceFocusOutEvents(dev, from, common, mode,
                                 NotifyNonlinearVirtual);
                     if (to->parent != NullWindow)
                         DeviceFocusInEvents(dev, common, to, mode, NotifyNonlinearVirtual);
-- 
1.7.7.4



More information about the xorg-devel mailing list