[mutter] stack: Make meta_window_raise() and meta_window_lower() smarter
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] stack: Make meta_window_raise() and meta_window_lower() smarter
- Date: Tue, 20 Mar 2012 21:09:35 +0000 (UTC)
commit 402b4774585f600fb5257e03856630fb36516599
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Tue Oct 18 00:39:08 2011 -0400
stack: Make meta_window_raise() and meta_window_lower() smarter
https://bugzilla.gnome.org/show_bug.cgi?id=620744
src/core/stack.c | 45 ++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 40 insertions(+), 5 deletions(-)
---
diff --git a/src/core/stack.c b/src/core/stack.c
index de1c9e0..42dd67c 100644
--- a/src/core/stack.c
+++ b/src/core/stack.c
@@ -184,10 +184,27 @@ meta_stack_update_transient (MetaStack *stack,
void
meta_stack_raise (MetaStack *stack,
MetaWindow *window)
-{
- meta_window_set_stack_position_no_sync (window,
- stack->n_positions - 1);
-
+{
+ GList *l;
+ int max_stack_position = window->stack_position;
+ MetaWorkspace *workspace;
+
+ g_assert (stack->added == NULL);
+
+ workspace = meta_window_get_workspace (window);
+ for (l = stack->sorted; l; l = l->next)
+ {
+ MetaWindow *w = (MetaWindow *) l->data;
+ if (meta_window_located_on_workspace (w, workspace) &&
+ w->stack_position > max_stack_position)
+ max_stack_position = w->stack_position;
+ }
+
+ if (max_stack_position == window->stack_position)
+ return;
+
+ meta_window_set_stack_position_no_sync (window, max_stack_position);
+
stack_sync_to_server (stack);
meta_stack_update_window_tile_matches (stack, window->screen->active_workspace);
}
@@ -196,7 +213,25 @@ void
meta_stack_lower (MetaStack *stack,
MetaWindow *window)
{
- meta_window_set_stack_position_no_sync (window, 0);
+ GList *l;
+ int min_stack_position = window->stack_position;
+ MetaWorkspace *workspace;
+
+ g_assert (stack->added == NULL);
+
+ workspace = meta_window_get_workspace (window);
+ for (l = stack->sorted; l; l = l->next)
+ {
+ MetaWindow *w = (MetaWindow *) l->data;
+ if (meta_window_located_on_workspace (w, workspace) &&
+ w->stack_position < min_stack_position)
+ min_stack_position = w->stack_position;
+ }
+
+ if (min_stack_position == window->stack_position)
+ return;
+
+ meta_window_set_stack_position_no_sync (window, min_stack_position);
stack_sync_to_server (stack);
meta_stack_update_window_tile_matches (stack, window->screen->active_workspace);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]