summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <sam.spilsbury@canonical.com>2010-12-07 23:49:46 +0800
committerSam Spilsbury <sam.spilsbury@canonical.com>2010-12-07 23:49:46 +0800
commit4666435ec53105675c67225e6d5fd18101627353 (patch)
treef68717b687b57ebb7a0d20eb5edb3e5347243341
parent7dd42ee0f33e186726a9bd7262c1e1ac2951756e (diff)
downloadcompiz-with-glib-mainloop-4666435ec53105675c67225e6d5fd18101627353.tar.gz
compiz-with-glib-mainloop-4666435ec53105675c67225e6d5fd18101627353.tar.bz2
Don't stack focus-denied windows in a disallowed position
When a window is focus-stealing-prevented, we should only stack it below the active window if that is possible. If it's not (the window has the "Above" state, for example), then we should stack it at the normal location. http://bugs.opencompositing.org/show_bug.cgi?id=1304 Forward port 984bca5801d6179b9f8081c4b6c466063975d940 to master
-rw-r--r--src/window.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/window.cpp b/src/window.cpp
index 3568878..32dc8b1 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -3329,14 +3329,19 @@ CompWindow::updateAttributes (CompStackingUpdateMode stackingMode)
if (p->priv->id == screen->activeWindow ())
break;
- /* window is above active window so we should lower it */
- if (p)
+ /* window is above active window so we should lower it,
+ * assuing that is allowed (if, for example, our window has
+ * the "above" state, then lowering beneath the active
+ * window may not be allowed). */
+ if (p && PrivateWindow::validSiblingBelow (p, this))
+ {
p = PrivateWindow::findValidStackSiblingBelow (sibling, p);
- /* if we found a valid sibling under the active window, it's
- our new sibling we want to stack above */
- if (p)
- sibling = p;
+ /* if we found a valid sibling under the active window, it's
+ our new sibling we want to stack above */
+ if (p)
+ sibling = p;
+ }
}
mask |= priv->addWindowStackChanges (&xwc, sibling);