summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2005-07-25 01:52:50 +0000
committerElijah Newren <newren@src.gnome.org>2005-07-25 01:52:50 +0000
commitc25b8ec616e69de4357dcbc1cbef0062e77d6c40 (patch)
treedf353d7b8816540f8dc5a6688434fac67a4da1a6
parentc64bda776bcd5b5c2bff9baf0b16a65d7577536c (diff)
downloadmetacity-c25b8ec616e69de4357dcbc1cbef0062e77d6c40.tar.gz
raise the window as well as its ancestor; fixes a stacking bug with an
2005-07-24 Elijah Newren <newren@gmail.com> * src/window.c (meta_window_raise): raise the window as well as its ancestor; fixes a stacking bug with an ancestor that has more than one child window. Fixes one of the issues in #307875.
-rw-r--r--ChangeLog8
-rw-r--r--src/window.c26
2 files changed, 29 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 29e07bf9..1a7cef95 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,15 @@
2005-07-24 Elijah Newren <newren@gmail.com>
+ * src/window.c (meta_window_raise): raise the window as well as
+ its ancestor; fixes a stacking bug with an ancestor that has more
+ than one child window. Fixes one of the issues in #307875.
+
+2005-07-24 Elijah Newren <newren@gmail.com>
+
* src/window.c (meta_window_free): restore original window size if
the window was maximized, as the FIXME says. ;-) Fixes #137185.
+ Thanks to Christian Persch for the testcase that made this easier
+ to track down.
2005-07-23 Elijah Newren <newren@gmail.com>
diff --git a/src/window.c b/src/window.c
index d79d7625..8ebb36ec 100644
--- a/src/window.c
+++ b/src/window.c
@@ -3827,18 +3827,34 @@ meta_window_raise (MetaWindow *window)
"Raising window %s, ancestor of %s\n",
ancestor->desc, window->desc);
- if (window->screen->stack != ancestor->screen->stack)
+ /* Raise the ancestor of the window (if the window has no ancestor,
+ * then ancestor will be set to the window itself); do this because
+ * it's weird to see windows from other apps stacked between a child
+ * and parent window of the currently active app. The stacking
+ * constraints in stack.c then magically take care of raising all
+ * the child windows appropriately.
+ */
+ if (window->screen->stack == ancestor->screen->stack)
+ meta_stack_raise (window->screen->stack, ancestor);
+ else
{
meta_warning (
"Either stacks aren't per screen or some window has a weird "
"transient_for hint; window->screen->stack != "
"ancestor->screen->stack. window = %s, ancestor = %s.\n",
window->desc, ancestor->desc);
- /* Just punt and raise the window itself */
- meta_stack_raise (window->screen->stack, window);
+ /* We could raise the window here, but don't want to do that twice and
+ * so we let the case below handle that.
+ */
}
- else
- meta_stack_raise (window->screen->stack, ancestor);
+
+ /* Okay, so stacking constraints misses one case: If a window has
+ * two children and we want to raise one of those children, then
+ * raising the ancestor isn't enough; we need to also raise the
+ * correct child. See bug 307875.
+ */
+ if (window != ancestor)
+ meta_stack_raise (window->screen->stack, window);
}
void