[PATCH] mi: start calculating the sprite trace from the first child of root

Peter Hutterer peter.hutterer at who-t.net
Tue Apr 29 18:25:52 PDT 2014

Introduced in
73698d41e41ce76bef2d9a90b46ac0c24ae148dd "Make XYToWindow a screen function"

Moving the code into miwindow.c changed the start of the loop from
RootWindow()->firstChild to DeepestSpriteWindow(). The latter isn't the first
child of the root, but the deepest (furthest from the root window) window.
This window may have disappeared since, causing all sorts of invalid

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
 mi/miwindow.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/mi/miwindow.c b/mi/miwindow.c
index 951b8c5..ed5a65e 100644
--- a/mi/miwindow.c
+++ b/mi/miwindow.c
@@ -763,10 +763,11 @@ miSegregateChildren(WindowPtr pWin, RegionPtr pReg, int depth)
 miSpriteTrace(SpritePtr pSprite, int x, int y)
-    WindowPtr pWin;
+    WindowPtr pWin, pRoot;
     BoxRec box;
-    pWin = DeepestSpriteWin(pSprite);
+    pRoot = pSprite->spriteTrace[0];
+    pWin = pRoot->firstChild;
     while (pWin) {
         if ((pWin->mapped) &&
             (x >= pWin->drawable.x - wBorderWidth(pWin)) &&

More information about the xorg-devel mailing list