All pastes #475228 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-05-07 10:07 UTC
rendered paste body
diff --git a/include/compiz.h b/include/compiz.h
index 59edee0..266f5f9 100644
--- a/include/compiz.h
+++ b/include/compiz.h
@@ -26,7 +26,7 @@
 #ifndef _COMPIZ_H
 #define _COMPIZ_H
 
-#define ABIVERSION 20070503
+#define ABIVERSION 20070504
 
 #include <stdio.h>
 #include <sys/time.h>
@@ -1193,6 +1193,11 @@ typedef void (*ApplyScreenTransformProc) (CompScreen     
                                          int                     output,
                                          CompTransform           *transform);
 
+typedef CompWindow* (*StackFirstProc) (CompScreen *screen);
+typedef CompWindow* (*StackLastProc) (CompScreen *screen);
+
+typedef CompWindow* (*StackNextProc) (CompWindow *window);
+typedef CompWindow* (*StackPrevProc) (CompWindow *window);
 /*
   window paint flags
 
@@ -1308,6 +1313,18 @@ applyScreenTransform (CompScreen       *screen,
                      int                     output,
                      CompTransform           *transform);
 
+CompWindow*
+stackFirst (CompScreen* screen);
+
+CompWindow*
+stackLast (CompScreen* screen);
+
+CompWindow*
+stackNext (CompWindow* window);
+
+CompWindow*
+stackPrev (CompWindow* window);
+
 Bool
 paintScreen (CompScreen                     *screen,
             const ScreenPaintAttrib *sAttrib,
@@ -1965,6 +1982,12 @@ struct _CompScreen {
     WindowStateChangeNotifyProc windowStateChangeNotify;
 
     OutputChangeNotifyProc outputChangeNotify;
+    
+    StackFirstProc stackFirst;
+    StackLastProc  stackLast;
+
+    StackNextProc  stackNext;
+    StackPrevProc  stackPrev;
 
     CompPrivate *privates;
 };
diff --git a/src/paint.c b/src/paint.c
index 39bcacc..e6f3d75 100644
--- a/src/paint.c
+++ b/src/paint.c
@@ -185,7 +185,7 @@ paintScreenRegion (CompScreen              *screen,
     XSubtractRegion (region, &emptyRegion, tmpRegion);
 
     /* detect occlusions */
-    for (w = screen->reverseWindows; w; w = w->prev)
+    for (w = (*screen->stackLast) (screen); w; (*screen->stackPrev) (w))
     {
        if (w->destroyed)
            continue;
@@ -221,7 +221,7 @@ paintScreenRegion (CompScreen              *screen,
     (*screen->paintBackground) (screen, tmpRegion, backgroundMask);
 
     /* paint all windows from bottom to top */
-    for (w = screen->windows; w; w = w->next)
+    for (w = (*screen->stackFirst) (screen); w; (*screen->stackNext) (w))
     {
        if (w->destroyed)
            continue;
@@ -378,6 +378,30 @@ paintScreen (CompScreen                 *screen,
     return TRUE;
 }
 
+CompWindow*
+stackFirst (CompScreen* screen)
+{
+    return screen->windows;
+}
+
+CompWindow*
+stackLast (CompScreen* screen)
+{
+    return screen->reverseWindows;
+}
+
+CompWindow*
+stackNext (CompWindow* window)
+{
+    return window->next;
+}
+
+CompWindow*
+stackPrev (CompWindow* window)
+{
+    return window->prev;
+}
+
 #define ADD_RECT(data, m, n, x1, y1, x2, y2)      \
     for (it = 0; it < n; it++)                    \
     {                                             \
diff --git a/src/screen.c b/src/screen.c
index d73ceb4..469e437 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -1540,6 +1540,12 @@ addScreen (CompDisplay *display,
     s->windowStateChangeNotify = windowStateChangeNotify;
 
     s->outputChangeNotify = outputChangeNotify;
+    
+    s->stackFirst = stackFirst;
+    s->stackLast = stackLast;
+    
+    s->stackNext = stackNext;
+    s->stackPrev = stackPrev;
 
     s->getProcAddress = 0;