summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/compiz-core.h20
-rw-r--r--include/compscreen.h10
-rw-r--r--include/wrapable.h10
-rw-r--r--src/display.cpp3
-rw-r--r--src/event.cpp2
-rw-r--r--src/option.cpp2
-rw-r--r--src/paint.cpp18
-rw-r--r--src/privatescreen.h4
-rw-r--r--src/screen.cpp250
-rw-r--r--src/window.cpp27
10 files changed, 132 insertions, 214 deletions
diff --git a/include/compiz-core.h b/include/compiz-core.h
index b07916f..4050a70 100644
--- a/include/compiz-core.h
+++ b/include/compiz-core.h
@@ -257,28 +257,8 @@ eventTerminates (CompDisplay *display,
#define DEG2RAD (M_PI / 180.0f)
-
-typedef void (*WalkerFiniProc) (CompScreen *screen,
- CompWalker *walker);
-
-typedef CompWindow *(*WalkInitProc) (CompScreen *screen);
-typedef CompWindow *(*WalkStepProc) (CompWindow *window);
-
-struct _CompWalker {
- WalkerFiniProc fini;
- CompPrivate priv;
-
- WalkInitProc first;
- WalkInitProc last;
- WalkStepProc next;
- WalkStepProc prev;
-};
-
-
/* screen.c */
-
-
/* window.c */
diff --git a/include/compscreen.h b/include/compscreen.h
index 09854ea..5124765 100644
--- a/include/compscreen.h
+++ b/include/compscreen.h
@@ -8,6 +8,7 @@
class CompScreen;
class PrivateScreen;
+typedef std::list<CompWindow *> CompWindowList;
#define GET_CORE_SCREEN(object) (dynamic_cast<CompScreen *> (object))
#define CORE_SCREEN(object) CompScreen *s = GET_CORE_SCREEN (object)
@@ -213,7 +214,7 @@ class ScreenInterface : public WrapableInterface<CompScreen> {
WRAPABLE_DEF(void, outputChangeNotify);
- WRAPABLE_DEF(void, initWindowWalker, CompWalker *walker);
+ WRAPABLE_DEF(CompWindowList, getWindowPaintList);
};
@@ -247,12 +248,9 @@ class CompScreen : public WrapableHandler<ScreenInterface>, public CompObject {
int
screenNum ();
- CompWindow *
+ CompWindowList &
windows ();
- CompWindow *
- reverseWindows ();
-
CompOption *
getOption (const char *name);
@@ -568,7 +566,7 @@ class CompScreen : public WrapableHandler<ScreenInterface>, public CompObject {
WRAPABLE_HND(void, outputChangeNotify);
- WRAPABLE_HND(void, initWindowWalker, CompWalker *walker);
+ WRAPABLE_HND(CompWindowList, getWindowPaintList);
GLXBindTexImageProc bindTexImage;
GLXReleaseTexImageProc releaseTexImage;
diff --git a/include/wrapable.h b/include/wrapable.h
index c92da4d..bcc3776 100644
--- a/include/wrapable.h
+++ b/include/wrapable.h
@@ -24,6 +24,16 @@
return 0; \
}
+#define WRAPABLE_DEF_FUNC_WITH_RETURN(ret, func, ...) \
+{ \
+ if (mHandler) \
+ { \
+ func ## _enabled = false; \
+ return mHandler-> func (__VA_ARGS__); \
+ } \
+ return ret; \
+}
+
#define WRAPABLE_HND(rtype, func, ...) public: rtype func (__VA_ARGS__); private: unsigned int mCurr_ ## func ; public:
#define WRAPABLE_HND_FUNC(func, ...) \
diff --git a/src/display.cpp b/src/display.cpp
index 18188eb..312a642 100644
--- a/src/display.cpp
+++ b/src/display.cpp
@@ -1139,7 +1139,6 @@ PrivateDisplay::setAudibleBell (bool audible)
bool
PrivateDisplay::handlePingTimeout ()
{
- CompWindow *w;
XEvent ev;
int ping = lastPing + 1;
@@ -1155,7 +1154,7 @@ PrivateDisplay::handlePingTimeout ()
foreach (CompScreen *s, screens)
{
- for (w = s->windows (); w; w = w->next)
+ foreach (CompWindow *w, s->windows ())
{
if (w->handlePingTimeout (lastPing))
{
diff --git a/src/event.cpp b/src/event.cpp
index 1af011d..afe0716 100644
--- a/src/event.cpp
+++ b/src/event.cpp
@@ -1918,7 +1918,7 @@ CompDisplay::handleEvent (XEvent *event)
foreach (s, priv->screens)
{
- for (w = s->windows (); w; w = w->next)
+ foreach (w, s->windows ())
{
if (w->syncAlarm () == sa->alarm)
{
diff --git a/src/option.cpp b/src/option.cpp
index c8d5a80..4178756 100644
--- a/src/option.cpp
+++ b/src/option.cpp
@@ -831,8 +831,10 @@ finiDisplayOptionValue (CompDisplay *d,
case CompOption::TypeEdge:
case CompOption::TypeBell:
if (v.action ().state () & CompAction::StateAutoGrab)
+ {
foreach (CompScreen *s, d->screens ())
s->removeAction (&v.action ());
+ }
break;
case CompOption::TypeList:
foreach (CompOption::Value &val, v.list ())
diff --git a/src/paint.cpp b/src/paint.cpp
index 72293a2..c2e6f4e 100644
--- a/src/paint.cpp
+++ b/src/paint.cpp
@@ -27,6 +27,9 @@
#include <string.h>
#include <math.h>
+#include <boost/foreach.hpp>
+#define foreach BOOST_FOREACH
+
#include <compiz-core.h>
#include "privatescreen.h"
@@ -174,13 +177,15 @@ PrivateScreen::paintOutputRegion (const CompTransform *transform,
CompWindow *w;
int count, windowMask, odMask;
CompWindow *fullscreenWindow = NULL;
- CompWalker walk;
bool status;
bool withOffset = false;
CompTransform vTransform;
int offX, offY;
Region clip = region;
+ CompWindowList pl;
+ CompWindowList::reverse_iterator rit;
+
if (!tmpRegion)
{
tmpRegion = XCreateRegion ();
@@ -201,13 +206,15 @@ PrivateScreen::paintOutputRegion (const CompTransform *transform,
XSubtractRegion (region, &emptyRegion, tmpRegion);
- screen->initWindowWalker (&walk);
+ pl = screen->getWindowPaintList ();
if (!(mask & PAINT_SCREEN_NO_OCCLUSION_DETECTION_MASK))
{
/* detect occlusions */
- for (w = (*walk.last) (screen); w; w = (*walk.prev) (w))
+ for (rit = pl.rbegin (); rit != pl.rend(); rit++)
{
+ w = (*rit);
+
if (w->destroyed ())
continue;
@@ -288,7 +295,7 @@ PrivateScreen::paintOutputRegion (const CompTransform *transform,
paintBackground (tmpRegion, (mask & PAINT_SCREEN_TRANSFORMED_MASK));
/* paint all windows from bottom to top */
- for (w = (*walk.first) (screen); w; w = (*walk.next) (w))
+ foreach (w, pl)
{
if (w->destroyed ())
continue;
@@ -322,9 +329,6 @@ PrivateScreen::paintOutputRegion (const CompTransform *transform,
w->paint (&w->paintAttrib (), transform, clip, windowMask);
}
}
-
- if (walk.fini)
- (*walk.fini) (screen, &walk);
}
void
diff --git a/src/privatescreen.h b/src/privatescreen.h
index 3f46b88..bf9dbb5 100644
--- a/src/privatescreen.h
+++ b/src/privatescreen.h
@@ -170,9 +170,7 @@ class PrivateScreen {
CompScreen *screen;
CompDisplay *display;
- CompWindow *windows;
- CompWindow *reverseWindows;
-
+ CompWindowList windows;
Colormap colormap;
int screenNum;
diff --git a/src/screen.cpp b/src/screen.cpp
index 8a929b4..729bf8b 100644
--- a/src/screen.cpp
+++ b/src/screen.cpp
@@ -1189,7 +1189,6 @@ CompScreen::updateOutputWindow ()
Display *dpy = priv->display->dpy ();
XserverRegion region;
static Region tmpRegion = NULL;
- CompWindow *w;
if (!tmpRegion)
{
@@ -1200,10 +1199,12 @@ CompScreen::updateOutputWindow ()
XSubtractRegion (&priv->region, &emptyRegion, tmpRegion);
- for (w = priv->reverseWindows; w; w = w->prev)
- if (w->overlayWindow ())
+
+ for (CompWindowList::reverse_iterator rit = priv->windows.rbegin ();
+ rit != priv->windows.rend (); rit++)
+ if ((*rit)->overlayWindow ())
{
- XSubtractRegion (tmpRegion, w->region (), tmpRegion);
+ XSubtractRegion (tmpRegion, (*rit)->region (), tmpRegion);
}
XShapeCombineRegion (dpy, priv->output, ShapeBounding,
@@ -1249,7 +1250,6 @@ CompScreen::enterShowDesktopMode ()
WRAPABLE_HND_FUNC(enterShowDesktopMode)
CompDisplay *d = priv->display;
- CompWindow *w;
unsigned long data = 1;
int count = 0;
CompOption *st = d->getOption ("hide_skip_taskbar_windows");
@@ -1257,7 +1257,7 @@ CompScreen::enterShowDesktopMode ()
priv->showingDesktopMask = ~(CompWindowTypeDesktopMask |
CompWindowTypeDockMask);
- for (w = priv->windows; w; w = w->next)
+ foreach (CompWindow *w, priv->windows)
{
if ((priv->showingDesktopMask & w->wmType ()) &&
(!(w->state () & CompWindowStateSkipTaskbarMask) ||
@@ -1292,7 +1292,6 @@ CompScreen::leaveShowDesktopMode (CompWindow *window)
{
WRAPABLE_HND_FUNC(leaveShowDesktopMode, window)
- CompWindow *w;
unsigned long data = 0;
if (window)
@@ -1304,7 +1303,7 @@ CompScreen::leaveShowDesktopMode (CompWindow *window)
window->show ();
/* return if some other window is still in show desktop mode */
- for (w = priv->windows; w; w = w->next)
+ foreach (CompWindow *w, priv->windows)
if (w->inShowDesktopMode ())
return;
@@ -1314,7 +1313,7 @@ CompScreen::leaveShowDesktopMode (CompWindow *window)
{
priv->showingDesktopMask = 0;
- for (w = priv->windows; w; w = w->next)
+ foreach (CompWindow *w, priv->windows)
{
if (!w->inShowDesktopMode ())
continue;
@@ -1334,40 +1333,12 @@ CompScreen::leaveShowDesktopMode (CompWindow *window)
(unsigned char *) &data, 1);
}
-static CompWindow *
-walkFirst (CompScreen *s)
-{
- return s->windows ();
-}
-
-static CompWindow *
-walkLast (CompScreen *s)
-{
- return s->reverseWindows ();
-}
-
-static CompWindow *
-walkNext (CompWindow *w)
-{
- return w->next;
-}
-
-static CompWindow *
-walkPrev (CompWindow *w)
-{
- return w->prev;
-}
-
-void
-CompScreen::initWindowWalker (CompWalker *walker)
+CompWindowList
+CompScreen::getWindowPaintList ()
{
- WRAPABLE_HND_FUNC(initWindowWalker, walker)
+ WRAPABLE_HND_FUNC_RETURN (CompWindowList, getWindowPaintList)
- walker->fini = NULL;
- walker->first = walkFirst;
- walker->last = walkLast;
- walker->next = walkNext;
- walker->prev = walkPrev;
+ return priv->windows;
}
CompScreen::CompScreen ():
@@ -1387,7 +1358,7 @@ CompScreen::CompScreen ():
WRAPABLE_INIT_HND(outputChangeNotify);
- WRAPABLE_INIT_HND(initWindowWalker);
+ WRAPABLE_INIT_HND(getWindowPaintList);
priv = new PrivateScreen (this);
assert (priv);
@@ -1400,8 +1371,7 @@ CompScreen::CompScreen ():
PrivateScreen::PrivateScreen (CompScreen *screen) :
screen(screen),
display (0),
- windows (0),
- reverseWindows (0),
+ windows (),
size (0, 0),
vp (0, 0),
vpSize (1, 1),
@@ -1674,7 +1644,6 @@ CompScreen::init (CompDisplay *display,
GLfloat ambientLight[] = { 0.0f, 0.0f, 0.0f, 0.0f };
GLfloat diffuseLight[] = { 0.9f, 0.9f, 0.9f, 0.9f };
GLfloat light0Position[] = { -0.5f, 0.5f, -9.0f, 1.0f };
- CompWindow *w;
priv->display = display;
@@ -2196,7 +2165,7 @@ CompScreen::init (CompDisplay *display,
for (i = 0; i < nchildren; i++)
new CompWindow (this, children[i], i ? children[i - 1] : 0);
- for (w = priv->windows; w; w = w->next)
+ foreach (CompWindow *w, priv->windows)
{
if (w->attrib ().map_state == IsViewable)
{
@@ -2260,8 +2229,8 @@ CompScreen::~CompScreen ()
{
priv->paintTimer.stop ();
- while (priv->windows)
- delete priv->windows;
+ while (!priv->windows.empty ())
+ delete priv->windows.front ();
objectFiniPlugins (this);
@@ -2284,8 +2253,6 @@ CompScreen::~CompScreen ()
XCompositeReleaseOverlayWindow (priv->display->dpy (), priv->root);
#endif
- int i, j;
-
if (priv->clientList)
free (priv->clientList);
@@ -2349,9 +2316,7 @@ CompScreen::damagePending ()
void
CompScreen::forEachWindow (ForEachWindowProc proc, void *closure)
{
- CompWindow *w;
-
- for (w = priv->windows; w; w = w->next)
+ foreach (CompWindow *w, priv->windows)
(*proc) (w, closure);
}
@@ -2375,8 +2340,11 @@ CompScreen::focusDefaultWindow ()
if (!focus)
{
- for (w = priv->reverseWindows; w; w = w->prev)
+ for (CompWindowList::reverse_iterator rit = priv->windows.rbegin ();
+ rit != priv->windows.rend (); rit++)
{
+ w = (*rit);
+
if (w->type () & CompWindowTypeDockMask)
continue;
@@ -2419,9 +2387,7 @@ CompScreen::findWindow (Window id)
}
else
{
- CompWindow *w;
-
- for (w = priv->windows; w; w = w->next)
+ foreach (CompWindow *w, priv->windows)
if (w->id () == id)
return (lastFoundWindow = w);
}
@@ -2443,7 +2409,7 @@ CompScreen::findTopLevelWindow (Window id)
/* likely a frame window */
if (w->attrib ().c_class == InputOnly)
{
- for (w = priv->windows; w; w = w->next)
+ foreach (w, priv->windows)
if (w->frame () == id)
return w;
}
@@ -2457,95 +2423,64 @@ CompScreen::findTopLevelWindow (Window id)
void
CompScreen::insertWindow (CompWindow *w, Window aboveId)
{
- CompWindow *p;
-
- if (priv->windows)
+ if (!aboveId || priv->windows.empty ())
{
- if (!aboveId)
+ if (!priv->windows.empty ())
{
- w->next = priv->windows;
- w->prev = NULL;
- priv->windows->prev = w;
- priv->windows = w;
+ priv->windows.front ()->prev = w;
+ w->next = priv->windows.front ();
}
- else
- {
- for (p = priv->windows; p; p = p->next)
- {
- if (p->id () == aboveId)
- {
- if (p->next)
- {
- w->next = p->next;
- w->prev = p;
- p->next->prev = w;
- p->next = w;
- }
- else
- {
- p->next = w;
- w->next = NULL;
- w->prev = p;
- priv->reverseWindows = w;
- }
- break;
- }
- }
+ priv->windows.push_front (w);
+ return;
+ }
+
+ CompWindowList::iterator it = priv->windows.begin ();
+
+ while (it != priv->windows.end ())
+ {
+ if ((*it)->id () == aboveId)
+ break;
+ it++;
+ }
+
+ if (it == priv->windows.end ())
+ {
#ifdef DEBUG
- if (!p)
- abort ();
+ abort ();
#endif
-
- }
+ return;
}
- else
+
+ w->next = (*it)->next;
+ w->prev = (*it);
+ (*it)->next = w;
+
+ if (w->next)
{
- priv->reverseWindows = priv->windows = w;
- w->prev = w->next = NULL;
+ w->next->prev = w;
}
+
+ priv->windows.insert (++it, w);
}
void
CompScreen::unhookWindow (CompWindow *w)
{
- CompWindow *next, *prev;
+ CompWindow *prev, *next;
+ CompWindowList::iterator it =
+ std::find (priv->windows.begin (), priv->windows.end (), w);
- next = w->next;
- prev = w->prev;
+ priv->windows.erase (it);
- if (next || prev)
- {
- if (next)
- {
- if (prev)
- {
- next->prev = prev;
- }
- else
- {
- priv->windows = next;
- next->prev = NULL;
- }
- }
+ if (w->next)
+ w->next->prev = w->prev;
- if (prev)
- {
- if (next)
- {
- prev->next = next;
- }
- else
- {
- priv->reverseWindows = prev;
- prev->next = NULL;
- }
- }
- }
- else
- {
- priv->windows = priv->reverseWindows = NULL;
- }
+ if (w->prev)
+ w->prev->next = w->next;
+
+ w->next = NULL;
+ w->prev = NULL;
if (w == lastFoundWindow)
lastFoundWindow = NULL;
@@ -2934,7 +2869,6 @@ void
PrivateScreen::computeWorkareaForBox (BoxPtr pBox,
XRectangle *area)
{
- CompWindow *w;
Region region;
REGION r;
int x1, y1, x2, y2;
@@ -2956,7 +2890,7 @@ PrivateScreen::computeWorkareaForBox (BoxPtr pBox,
XUnionRegion (&r, region, region);
- for (w = windows; w; w = w->next)
+ foreach (CompWindow *w, windows)
{
if (!w->mapNum ())
continue;
@@ -3069,11 +3003,9 @@ CompScreen::updateWorkarea ()
if (workAreaChanged)
{
- CompWindow *w;
-
/* as work area changed, update all maximized windows on this
screen to snap to the new work area */
- for (w = priv->windows; w; w = w->next)
+ foreach (CompWindow *w, priv->windows)
w->updateSize ();
}
}
@@ -3172,7 +3104,7 @@ CompScreen::updateClientList ()
clientListStacking = clientList + n;
i = 0;
- for (CompWindow *w = priv->windows; w; w = w->next)
+ foreach (CompWindow *w, priv->windows)
if (isClientListWindow (w))
{
priv->clientList[i] = w;
@@ -3283,7 +3215,6 @@ CompScreen::runCommand (CompString command)
void
CompScreen::moveViewport (int tx, int ty, bool sync)
{
- CompWindow *w;
int wx, wy;
tx = priv->vp.x () - tx;
@@ -3303,7 +3234,7 @@ CompScreen::moveViewport (int tx, int ty, bool sync)
tx *= -priv->size.width ();
ty *= -priv->size.height ();
- for (w = priv->windows; w; w = w->next)
+ foreach (CompWindow *w, priv->windows)
{
if (w->onAllViewports ())
continue;
@@ -3325,6 +3256,8 @@ CompScreen::moveViewport (int tx, int ty, bool sync)
if (sync)
{
+ CompWindow *w;
+
priv->setDesktopHints ();
setCurrentActiveWindowHistory (priv->vp.x (), priv->vp.y ());
@@ -3497,13 +3430,12 @@ CompScreen::disableEdge (int edge)
Window
CompScreen::getTopWindow ()
{
- CompWindow *w;
-
/* return first window that has not been destroyed */
- for (w = priv->reverseWindows; w; w = w->prev)
+ for (CompWindowList::reverse_iterator rit = priv->windows.rbegin ();
+ rit != priv->windows.rend (); rit++)
{
- if (w->id () > 1)
- return w->id ();
+ if ((*rit)->id () > 1)
+ return (*rit)->id ();
}
return None;
@@ -3558,8 +3490,6 @@ CompScreen::getCurrentOutputExtents (int *x1, int *y1, int *x2, int *y2)
void
CompScreen::setNumberOfDesktops (unsigned int nDesktop)
{
- CompWindow *w;
-
if (nDesktop < 1 || nDesktop >= 0xffffffff)
return;
@@ -3569,7 +3499,7 @@ CompScreen::setNumberOfDesktops (unsigned int nDesktop)
if (priv->currentDesktop >= nDesktop)
priv->currentDesktop = nDesktop - 1;
- for (w = priv->windows; w; w = w->next)
+ foreach (CompWindow *w, priv->windows)
{
if (w->desktop () == 0xffffffff)
continue;
@@ -3587,7 +3517,6 @@ void
CompScreen::setCurrentDesktop (unsigned int desktop)
{
unsigned long data;
- CompWindow *w;
if (desktop >= priv->nDesktop)
return;
@@ -3597,7 +3526,7 @@ CompScreen::setCurrentDesktop (unsigned int desktop)
priv->currentDesktop = desktop;
- for (w = priv->windows; w; w = w->next)
+ foreach (CompWindow *w, priv->windows)
{
if (w->desktop () == 0xffffffff)
continue;
@@ -3941,7 +3870,7 @@ ScreenInterface::ScreenInterface ()
WRAPABLE_INIT_FUNC(outputChangeNotify);
- WRAPABLE_INIT_FUNC(initWindowWalker);
+ WRAPABLE_INIT_FUNC(getWindowPaintList);
}
void
@@ -4003,9 +3932,9 @@ void
ScreenInterface::outputChangeNotify ()
WRAPABLE_DEF_FUNC(outputChangeNotify)
-void
-ScreenInterface::initWindowWalker (CompWalker *walker)
- WRAPABLE_DEF_FUNC(initWindowWalker, walker)
+CompWindowList
+ScreenInterface::getWindowPaintList ()
+ WRAPABLE_DEF_FUNC_WITH_RETURN(CompWindowList (), getWindowPaintList)
CompDisplay *
CompScreen::display ()
@@ -4236,18 +4165,12 @@ CompScreen::warpPointer (int dx, int dy)
}
}
-CompWindow *
+CompWindowList &
CompScreen::windows ()
{
return priv->windows;
}
-CompWindow *
-CompScreen::reverseWindows ()
-{
- return priv->reverseWindows;
-}
-
Time
CompScreen::getCurrentTime ()
{
@@ -4320,8 +4243,11 @@ CompScreen::handlePaintTimeout ()
/* substract top most overlay window region */
if (priv->overlayWindowCount)
{
- for (CompWindow *w = priv->reverseWindows; w; w = w->prev)
+ for (CompWindowList::reverse_iterator rit = priv->windows.rbegin ();
+ rit != priv->windows.rend (); rit++)
{
+ CompWindow *w = (*rit);
+
if (w->destroyed () || w->invisible ())
continue;
@@ -4449,9 +4375,7 @@ CompScreen::handlePaintTimeout ()
/* remove destroyed windows */
while (priv->pendingDestroys)
{
- CompWindow *w;
-
- for (w = priv->windows; w; w = w->next)
+ foreach (CompWindow *w, priv->windows)
{
if (w->destroyed ())
{
diff --git a/src/window.cpp b/src/window.cpp
index 5279812..ab38750 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -1922,7 +1922,7 @@ PrivateWindow::getModalTransient ()
modalTransient = window;
- for (w = window->priv->screen->reverseWindows (); w; w = w->prev)
+ for (w = window->priv->screen->windows ().back (); w; w = w->prev)
{
if (w == modalTransient || w->priv->mapNum == 0)
continue;
@@ -1932,7 +1932,7 @@ PrivateWindow::getModalTransient ()
if (w->priv->state & CompWindowStateModalMask)
{
modalTransient = w;
- w = window->priv->screen->reverseWindows ();
+ w = window->priv->screen->windows ().back ();
}
}
}
@@ -1944,7 +1944,7 @@ PrivateWindow::getModalTransient ()
if (state & CompWindowStateModalMask)
return NULL;
- for (w = window->priv->screen->reverseWindows (); w; w = w->prev)
+ for (w = window->priv->screen->windows ().back (); w; w = w->prev)
{
if (w == modalTransient || w->priv->mapNum == 0)
continue;
@@ -2026,7 +2026,8 @@ CompWindow::moveInputFocusTo ()
CompWindow *ancestor;
/* move input to closest ancestor */
- for (ancestor = s->windows (); ancestor; ancestor = ancestor->next)
+ for (ancestor = s->windows ().front (); ancestor;
+ ancestor = ancestor->next)
{
if (PrivateWindow::isAncestorTo (this, ancestor))
{
@@ -2064,7 +2065,7 @@ CompWindow::moveInputFocusToOtherWindow ()
{
CompWindow *a, *focus = NULL;
- for (a = priv->screen->reverseWindows (); a; a = a->prev)
+ for (a = priv->screen->windows ().back (); a; a = a->prev)
{
if (a->priv->clientLeader == priv->clientLeader)
{
@@ -2172,7 +2173,8 @@ PrivateWindow::findSiblingBelow (CompWindow *w,
if (w->priv->transientFor || w->priv->isGroupTransient (clientLeader))
clientLeader = None;
- for (below = w->priv->screen->reverseWindows (); below; below = below->prev)
+ for (below = w->priv->screen->windows ().back (); below;
+ below = below->prev)
{
if (below == w || avoidStackingRelativeTo (below))
continue;
@@ -2218,7 +2220,7 @@ PrivateWindow::findSiblingBelow (CompWindow *w,
CompWindow *
PrivateWindow::findLowestSiblingBelow (CompWindow *w)
{
- CompWindow *below, *lowest = w->priv->screen->reverseWindows ();
+ CompWindow *below, *lowest = w->priv->screen->windows ().back ();
Window clientLeader = w->priv->clientLeader;
unsigned int type = w->priv->type;
@@ -2230,7 +2232,8 @@ PrivateWindow::findLowestSiblingBelow (CompWindow *w)
if (w->priv->transientFor || w->priv->isGroupTransient (clientLeader))
clientLeader = None;
- for (below = w->priv->screen->reverseWindows (); below; below = below->prev)
+ for (below = w->priv->screen->windows ().back (); below;
+ below = below->prev)
{
if (below == w || avoidStackingRelativeTo (below))
continue;
@@ -2442,7 +2445,7 @@ PrivateWindow::stackTransients (CompWindow *w,
if (w->priv->transientFor || w->priv->isGroupTransient (clientLeader))
clientLeader = None;
- for (t = w->priv->screen->reverseWindows (); t; t = t->prev)
+ for (t = w->priv->screen->windows ().back (); t; t = t->prev)
{
if (t == w || t == avoid)
continue;
@@ -2500,7 +2503,7 @@ PrivateWindow::stackAncestors (CompWindow *w,
{
CompWindow *a;
- for (a = w->priv->screen->reverseWindows (); a; a = a->prev)
+ for (a = w->priv->screen->windows ().back (); a; a = a->prev)
{
if (a->priv->clientLeader == w->priv->clientLeader &&
a->priv->transientFor == None &&
@@ -3044,7 +3047,7 @@ PrivateWindow::addWindowStackChanges (XWindowChanges *xwc,
{
CompWindow *dw;
- for (dw = screen->reverseWindows (); dw; dw = dw->prev)
+ for (dw = screen->windows ().back (); dw; dw = dw->prev)
if (dw == sibling)
break;
@@ -3110,7 +3113,7 @@ PrivateWindow::findValidStackSiblingBelow (CompWindow *w,
lowest = last = findLowestSiblingBelow (w);
/* walk from bottom up */
- for (p = w->priv->screen->windows (); p; p = p->next)
+ for (p = w->priv->screen->windows ().front (); p; p = p->next)
{
/* stop walking when we reach the sibling we should try to stack
below */