summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Reveman <davidr@novell.com>2007-07-27 13:22:45 -0400
committerDavid Reveman <davidr@novell.com>2007-07-27 13:22:45 -0400
commit651f5d55c078fc7963e12208e2c84d3e0352c1fe (patch)
treea2d7fca169ab1759ece05024e7984cda00ef2723
parentd17c177c7a944d277941d19d6977414d974b4b29 (diff)
Skip windows that we should avoid stacking relative to.
-rw-r--r--src/window.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/window.c b/src/window.c
index 0f6aa08f..1a24bd91 100644
--- a/src/window.c
+++ b/src/window.c
@@ -3813,10 +3813,10 @@ void
restackWindowBelow (CompWindow *w,
CompWindow *sibling)
{
- CompWindow *lowest, *p;
+ CompWindow *lowest, *last, *p;
/* get lowest sibling we're allowed to stack above */
- lowest = findLowestSiblingBelow (w);
+ lowest = last = findLowestSiblingBelow (w);
/* walk from bottom up */
for (p = w->screen->windows; p; p = p->next)
@@ -3835,14 +3835,22 @@ restackWindowBelow (CompWindow *w,
return;
}
+ /* skip windows that we should avoid */
+ if (avoidStackingRelativeTo (p))
+ continue;
+
if (validSiblingBelow (w, p))
{
/* update lowest as we find windows below sibling that we're
- allowed to stack above but also make sure that we were allowed
- to stack above the previous window */
- if (p->prev == lowest)
+ allowed to stack above. last window must be equal to the
+ lowest as we shouldn't update lowest if we passed an
+ invalid window */
+ if (last == lowest)
lowest = p;
}
+
+ /* update last pointer */
+ last = p;
}
}