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

Keith Packard keithp at keithp.com
Wed Apr 30 09:57:44 PDT 2014


Peter Hutterer <peter.hutterer at who-t.net> writes:

> 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
> reads/writes.

miSpriteTrace is exposed so that XWayland can set up a partial sprite
trace based on the Wayland event delivery and then have the regular code
follow the tree down to the deepest child. It won't ever be called
directly by a regular X server; the usual screen function is
miXYToWindow.

miXYToWindow sets pSprite->spriteTraceGood to 1 before calling
miSpriteTrace, so DeepestSpriteWin(pSprite) will always be pRoot.

>  WindowPtr
>  miSpriteTrace(SpritePtr pSprite, int x, int y)
>  {
> -    WindowPtr pWin;
> +    WindowPtr pWin, pRoot;
>      BoxRec box;
>  
> -    pWin = DeepestSpriteWin(pSprite);
> +    pRoot = pSprite->spriteTrace[0];
> +    pWin = pRoot->firstChild;

What you did find is that we aren't looping over the children of the
deepest sprite window, which is wrong. We should be doing

        pWin = DeepestSpriteWin(pSprite)->firstChild;

With this, we're back to the previous behavior.

-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 810 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20140430/589ba424/attachment.sig>


More information about the xorg-devel mailing list