[PATCH] dix: reset pScreen->root to NULL when root window is deleted.

Keith Packard keithp at keithp.com
Sun Aug 15 20:54:37 PDT 2010


On Mon, 16 Aug 2010 12:21:15 +1000, Dave Airlie <airlied at gmail.com> wrote:

> diff --git a/dix/window.c b/dix/window.c
> index 4a47dd5..33ef943 100644
> --- a/dix/window.c
> +++ b/dix/window.c
> @@ -895,10 +895,15 @@ DeleteWindow(pointer value, XID wid)
>      WindowPtr pParent;
>      WindowPtr pWin = (WindowPtr)value;
>      xEvent event;
> +    ScreenPtr pScreen;
> +
> +    pScreen = pWin->drawable.pScreen;
>  
>      UnmapWindow(pWin, FALSE);
>  
>      CrushTree(pWin);
> +    if (pWin == pScreen->root)
> +	pScreen->root = NULL;
>  
>      pParent = pWin->parent;
>      if (wid && pParent && SubStrSend(pWin, pParent))
> -- 
> 1.7.2.1

Or perhaps this one instead?

diff --git a/dix/window.c b/dix/window.c
index 4a47dd5..1913030 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -921,6 +921,8 @@ DeleteWindow(pointer value, XID wid)
        if (pWin->prevSib)
            pWin->prevSib->nextSib = pWin->nextSib;
     }
+    else
+       pWin->drawable.pScreen->root = NULL;
     dixFreeObjectWithPrivates(pWin, PRIVATE_WINDOW);
     return Success;
 }

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


More information about the xorg-devel mailing list