diff options
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | src/window.c | 35 |
2 files changed, 42 insertions, 2 deletions
@@ -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 |