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.
This commit is contained in:
Elijah Newren 2005-07-25 01:52:50 +00:00 committed by Elijah Newren
parent c64bda776b
commit c25b8ec616
2 changed files with 29 additions and 5 deletions

View File

@ -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> 2005-07-24 Elijah Newren <newren@gmail.com>
* src/window.c (meta_window_free): restore original window size if * src/window.c (meta_window_free): restore original window size if
the window was maximized, as the FIXME says. ;-) Fixes #137185. 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> 2005-07-23 Elijah Newren <newren@gmail.com>

View File

@ -3827,18 +3827,34 @@ meta_window_raise (MetaWindow *window)
"Raising window %s, ancestor of %s\n", "Raising window %s, ancestor of %s\n",
ancestor->desc, window->desc); 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 ( meta_warning (
"Either stacks aren't per screen or some window has a weird " "Either stacks aren't per screen or some window has a weird "
"transient_for hint; window->screen->stack != " "transient_for hint; window->screen->stack != "
"ancestor->screen->stack. window = %s, ancestor = %s.\n", "ancestor->screen->stack. window = %s, ancestor = %s.\n",
window->desc, ancestor->desc); window->desc, ancestor->desc);
/* Just punt and raise the window itself */ /* We could raise the window here, but don't want to do that twice and
meta_stack_raise (window->screen->stack, window); * 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 void