[PATCH 21/37] dix: Drive tree mark/validate on unmap from paintable not viewable

Peter Harris pharris at opentext.com
Mon Oct 20 16:23:34 PDT 2014


It's possible I missed a patch or resolved a conflict incorrectly, but
I'm getting crashes after this patch series.

Reproducible by running twm and opening/closing the root window popup menu.

On 2014-10-08 11:04, Adam Jackson wrote:
> @@ -2742,7 +2742,7 @@ UnmapWindow(WindowPtr pWin, Bool fromConfigure)
>          return Success;
>      if (SubStrSend(pWin, pParent))
>          DeliverUnmapNotify(pWin, fromConfigure);
> -    if (wasViewable && !fromConfigure) {
> +    if (wasPaintable && !fromConfigure) {
>          pWin->valdata = UnmapValData;

UnmapValData is a special not-pointer that is only valid if
!pWin->paintable (or !pWin->viewable before this patch series). If
Composite resets pWin->paintable on this window, miComputeClips will dx
= pParent->drawable.x - pParent->valdata->before.oldAbsCorner.x; causing
everything to explode.

>          (*pScreen->MarkOverlappedWindows) (pWin, pWin->nextSib, &pLayerWin);
>          (*pScreen->MarkWindow) (pLayerWin->parent);
> @@ -2750,13 +2750,11 @@ UnmapWindow(WindowPtr pWin, Bool fromConfigure)
>      pWin->mapped = FALSE;
>      if (wasRealized)
>          UnrealizeTree(pWin, fromConfigure);
> -    if (wasViewable) {
> -        if (!fromConfigure) {
> -            (*pScreen->ValidateTree) (pLayerWin->parent, pWin, VTUnmap);
> -            (*pScreen->HandleExposures) (pLayerWin->parent);
> -            if (pScreen->PostValidateTree)
> -                (*pScreen->PostValidateTree) (pLayerWin->parent, pWin, VTUnmap);
> -        }
> +    if (wasPaintable && !fromConfigure) {

An extra block here

+            if (pWin->paintable) {
+                pWin->valdata = NULL;
+                pScreen->MarkWindow(pWin);
+            }

appears to fix the crash. I haven't considered the equivalent for
UnmapSubwindows yet.

Peter Harris
-- 
               Open Text Connectivity Solutions Group
Peter Harris                    http://connectivity.opentext.com/
Research and Development        Phone: +1 905 762 6001
pharris at opentext.com            Toll Free: 1 877 359 4866


More information about the xorg-devel mailing list