[PATCH 2/5] dix: remove ->GetLayerWin from the screen

Adam Jackson ajax at redhat.com
Tue Feb 17 15:59:43 PST 2015


Again, this is to enable the overlay visual case, but none of the extant
overlay implementations actually do anything with this method.  The mi
version just returns the first child of its argument, and then all the
callers check whether the child's parent is the same as that argument.
Since this will always be true we can fold this all away.

Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 dix/window.c         | 42 +++++++-----------------------------------
 doc/Xserver-spec.xml |  8 --------
 include/scrnintstr.h |  4 ----
 mi/mi.h              |  3 ---
 mi/miscrinit.c       |  1 -
 mi/miwindow.c        |  6 ------
 6 files changed, 7 insertions(+), 57 deletions(-)

diff --git a/dix/window.c b/dix/window.c
index 7c1a585..9d3d2ac 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -2611,7 +2611,6 @@ MapSubwindows(WindowPtr pParent, ClientPtr client)
     Mask parentRedirect;
     Mask parentNotify;
     Bool anyMarked;
-    WindowPtr pLayerWin;
 
     pScreen = pParent->drawable.pScreen;
     parentRedirect = RedirectSend(pParent);
@@ -2639,17 +2638,11 @@ MapSubwindows(WindowPtr pParent, ClientPtr client)
     }
 
     if (pFirstMapped) {
-        pLayerWin = (*pScreen->GetLayerWindow) (pParent);
-        if (pLayerWin->parent != pParent) {
-            anyMarked |= (*pScreen->MarkOverlappedWindows) (pLayerWin,
-                                                            pLayerWin);
-            pFirstMapped = pLayerWin;
-        }
         if (anyMarked) {
-            (*pScreen->ValidateTree) (pLayerWin->parent, pFirstMapped, VTMap);
-            (*pScreen->HandleExposures) (pLayerWin->parent);
+            (*pScreen->ValidateTree) (pWin->parent, pFirstMapped, VTMap);
+            (*pScreen->HandleExposures) (pWin->parent);
             if (pScreen->PostValidateTree)
-                (*pScreen->PostValidateTree) (pLayerWin->parent, pFirstMapped,
+                (*pScreen->PostValidateTree) (pWin->parent, pFirstMapped,
                                               VTMap);
         }
         WindowsRestructured();
@@ -2769,7 +2762,6 @@ UnmapSubwindows(WindowPtr pWin)
     Bool wasViewable = (Bool) pWin->viewable;
     Bool anyMarked = FALSE;
     Mask parentNotify;
-    WindowPtr pLayerWin = NULL;
     ScreenPtr pScreen = pWin->drawable.pScreen;
 
     if (!pWin->firstChild)
@@ -2777,9 +2769,6 @@ UnmapSubwindows(WindowPtr pWin)
     parentNotify = SubSend(pWin);
     pHead = RealChildHead(pWin);
 
-    if (wasViewable)
-        pLayerWin = (*pScreen->GetLayerWindow) (pWin);
-
     for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib) {
         if (pChild->mapped) {
             if (parentNotify || StrSend(pChild))
@@ -2795,28 +2784,11 @@ UnmapSubwindows(WindowPtr pWin)
     }
     if (wasViewable) {
         if (anyMarked) {
-            if (pLayerWin->parent == pWin)
-                (*pScreen->MarkWindow) (pWin);
-            else {
-                WindowPtr ptmp;
-
-                (*pScreen->MarkOverlappedWindows) (pWin, pLayerWin);
-                (*pScreen->MarkWindow) (pLayerWin->parent);
-
-                /* Windows between pWin and pLayerWin may not have been marked */
-                ptmp = pWin;
-
-                while (ptmp != pLayerWin->parent) {
-                    (*pScreen->MarkWindow) (ptmp);
-                    ptmp = ptmp->parent;
-                }
-                pHead = pWin->firstChild;
-            }
-            (*pScreen->ValidateTree) (pLayerWin->parent, pHead, VTUnmap);
-            (*pScreen->HandleExposures) (pLayerWin->parent);
+            (*pScreen->MarkWindow) (pWin);
+            (*pScreen->ValidateTree) (pWin->parent, pHead, VTUnmap);
+            (*pScreen->HandleExposures) (pWin->parent);
             if (pScreen->PostValidateTree)
-                (*pScreen->PostValidateTree) (pLayerWin->parent, pHead,
-                                              VTUnmap);
+                (*pScreen->PostValidateTree) (pWin->parent, pHead, VTUnmap);
         }
     }
     if (wasRealized) {
diff --git a/doc/Xserver-spec.xml b/doc/Xserver-spec.xml
index 2845b2e..6ceb525 100644
--- a/doc/Xserver-spec.xml
+++ b/doc/Xserver-spec.xml
@@ -3540,14 +3540,6 @@ is given by w,h.</para>
 <para>
 <blockquote><programlisting>
 
-    WindowPtr pScreen->GetLayerWindow(pWin)
-	WindowPtr pWin
-
-</programlisting></blockquote>
-This is a new function which returns a child of the layer parent of pWin.</para>
-<para>
-<blockquote><programlisting>
-
     void pScreen->HandleExposures(pWin)
 	WindowPtr pWin;
 
diff --git a/include/scrnintstr.h b/include/scrnintstr.h
index 4c73bd4..5d53ea1 100644
--- a/include/scrnintstr.h
+++ b/include/scrnintstr.h
@@ -306,9 +306,6 @@ typedef void (*ResizeWindowProcPtr) (WindowPtr /*pWin */ ,
                                      WindowPtr  /*pSib */
     );
 
-typedef WindowPtr (*GetLayerWindowProcPtr) (WindowPtr   /*pWin */
-    );
-
 typedef void (*HandleExposuresProcPtr) (WindowPtr /*pWin */ );
 
 typedef void (*ReparentWindowProcPtr) (WindowPtr /*pWin */ ,
@@ -560,7 +557,6 @@ typedef struct _Screen {
     ConfigNotifyProcPtr ConfigNotify;
     MoveWindowProcPtr MoveWindow;
     ResizeWindowProcPtr ResizeWindow;
-    GetLayerWindowProcPtr GetLayerWindow;
     HandleExposuresProcPtr HandleExposures;
     ReparentWindowProcPtr ReparentWindow;
 
diff --git a/mi/mi.h b/mi/mi.h
index fa703d0..9916747 100644
--- a/mi/mi.h
+++ b/mi/mi.h
@@ -461,9 +461,6 @@ extern _X_EXPORT void miResizeWindow(WindowPtr /*pWin */ ,
                                      WindowPtr    /*pSib */
     );
 
-extern _X_EXPORT WindowPtr miGetLayerWindow(WindowPtr   /*pWin */
-    );
-
 extern _X_EXPORT void miSetShape(WindowPtr /*pWin */ ,
                                  int    /*kind */
     );
diff --git a/mi/miscrinit.c b/mi/miscrinit.c
index b53c7e4..94afc04 100644
--- a/mi/miscrinit.c
+++ b/mi/miscrinit.c
@@ -265,7 +265,6 @@ miScreenInit(ScreenPtr pScreen, void *pbits,  /* pointer to screen bits */
     pScreen->MarkOverlappedWindows = miMarkOverlappedWindows;
     pScreen->MoveWindow = miMoveWindow;
     pScreen->ResizeWindow = miResizeWindow;
-    pScreen->GetLayerWindow = miGetLayerWindow;
     pScreen->HandleExposures = miHandleValidateExposures;
     pScreen->ReparentWindow = (ReparentWindowProcPtr) 0;
     pScreen->ChangeBorderWidth = miChangeBorderWidth;
diff --git a/mi/miwindow.c b/mi/miwindow.c
index a770a02..d8c3283 100644
--- a/mi/miwindow.c
+++ b/mi/miwindow.c
@@ -602,12 +602,6 @@ miResizeWindow(WindowPtr pWin, int x, int y, unsigned int w, unsigned int h,
         WindowsRestructured();
 }
 
-WindowPtr
-miGetLayerWindow(WindowPtr pWin)
-{
-    return pWin->firstChild;
-}
-
 /******
  *
  * miSetShape
-- 
1.9.3



More information about the xorg-devel mailing list