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

Dave Airlie airlied at gmail.com
Sun Aug 15 21:09:20 PDT 2010


On Mon, Aug 16, 2010 at 1:54 PM, Keith Packard <keithp at keithp.com> wrote:
> 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?

Indeed, I bow to your superior X internals knowledge.

Reviewed-by: Dave Airlie <airlied at redhat.com>

>
> 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
>


More information about the xorg-devel mailing list