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

Peter Hutterer peter.hutterer at who-t.net
Wed Apr 30 22:36:07 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(). This function is only
supposed to be called from miXYToWindow which resets spriteTraceGood to 1,
thus DeepestSpriteWindow() is always the root window anyway.
What got dropped was the firstChild as the first window to handle, so we may
end up with the root window twice in the sprite trace.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
Changes to v1:
- keep DeepestSpriteWindow, but use firstChild to start looping

 mi/miwindow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mi/miwindow.c b/mi/miwindow.c
index 951b8c5..57de91b 100644
--- a/mi/miwindow.c
+++ b/mi/miwindow.c
@@ -766,7 +766,7 @@ miSpriteTrace(SpritePtr pSprite, int x, int y)
     WindowPtr pWin;
     BoxRec box;
-    pWin = DeepestSpriteWin(pSprite);
+    pWin = DeepestSpriteWin(pSprite)->firstChild;
     while (pWin) {
         if ((pWin->mapped) &&
             (x >= pWin->drawable.x - wBorderWidth(pWin)) &&

More information about the xorg-devel mailing list