summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2005-02-12 07:34:30 +0000
committerElijah Newren <newren@src.gnome.org>2005-02-12 07:34:30 +0000
commit0488efc8c1347d25be5bd5adcf9f8d3687ccecb4 (patch)
treec837c06726799238a4e627b5dc17a2e287081c6b
parent9fa5c1d4b976213041fd134a2f00bd15d9de68e0 (diff)
downloadmetacity-0488efc8c1347d25be5bd5adcf9f8d3687ccecb4.tar.gz
Raise the ancestor of a window instead of the window itself. Fixes
2005-02-12 Elijah Newren <newren@gmail.com> Raise the ancestor of a window instead of the window itself. Fixes #166894. * src/window.c: (find_root_ancestor): new function, (meta_window_raise): get the ancestor of the given window and raise it if possible instead of the window
-rw-r--r--ChangeLog9
-rw-r--r--src/window.c35
2 files changed, 42 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 3ab2ba13..37368ffb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2005-02-12 Elijah Newren <newren@gmail.com>
+ Raise the ancestor of a window instead of the window itself.
+ Fixes #166894.
+
+ * src/window.c: (find_root_ancestor): new function,
+ (meta_window_raise): get the ancestor of the given window and
+ raise it if possible instead of the window
+
+2005-02-12 Elijah Newren <newren@gmail.com>
+
Don't unconditionally place splashscreens (and other
not-to-befocused windows) below the focus window. Fixes #167042.
diff --git a/src/window.c b/src/window.c
index 34830c31..8470e259 100644
--- a/src/window.c
+++ b/src/window.c
@@ -3654,13 +3654,44 @@ meta_window_set_current_workspace_hint (MetaWindow *window)
meta_error_trap_pop (window->display, FALSE);
}
+static gboolean
+find_root_ancestor (MetaWindow *window,
+ void *data)
+{
+ MetaWindow **ancestor = data;
+
+ /* Overwrite the previously "most-root" ancestor with the new one found */
+ *ancestor = window;
+
+ /* We want this to continue until meta_window_foreach_ancestor quits because
+ * there are no more valid ancestors.
+ */
+ return TRUE;
+}
+
void
meta_window_raise (MetaWindow *window)
{
+ MetaWindow *ancestor;
+ ancestor = window;
+ meta_window_foreach_ancestor (window, find_root_ancestor, &ancestor);
+
meta_topic (META_DEBUG_WINDOW_OPS,
- "Raising window %s\n", window->desc);
+ "Raising window %s, ancestor of %s\n",
+ ancestor->desc, window->desc);
- meta_stack_raise (window->screen->stack, window);
+ if (window->screen->stack != ancestor->screen->stack)
+ {
+ 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);
+ }
+ else
+ meta_stack_raise (window->screen->stack, ancestor);
}
void