Fix stacking for transients vs helper windows. Fixes bug #3851

This allows transient windows to be above helper windows.  And generally keeps
helper windows below transients, unless they are raised directly.
This commit is contained in:
Dana Jansens 2009-12-09 10:09:43 -05:00
parent 4e0a4fb53b
commit 0c0ddc3628

View file

@ -216,6 +216,7 @@ static void restack_windows(ObClient *selected, gboolean raise)
GList *it, *last, *below, *above, *next; GList *it, *last, *below, *above, *next;
GList *wins = NULL; GList *wins = NULL;
GList *group_helpers = NULL;
GList *group_modals = NULL; GList *group_modals = NULL;
GList *group_trans = NULL; GList *group_trans = NULL;
GList *modals = NULL; GList *modals = NULL;
@ -246,6 +247,8 @@ static void restack_windows(ObClient *selected, gboolean raise)
/* only move windows in the same stacking layer */ /* only move windows in the same stacking layer */
if (ch->layer == selected->layer && if (ch->layer == selected->layer &&
/* looking for windows that are transients, and so would
remain above the selected window */
client_search_transient(selected, ch)) client_search_transient(selected, ch))
{ {
if (client_is_direct_child(selected, ch)) { if (client_is_direct_child(selected, ch)) {
@ -254,6 +257,13 @@ static void restack_windows(ObClient *selected, gboolean raise)
else else
trans = g_list_prepend(trans, ch); trans = g_list_prepend(trans, ch);
} }
else if (client_helper(ch)) {
if (selected->transient) {
/* helpers do not stay above transient windows */
continue;
}
group_helpers = g_list_prepend(group_helpers, ch);
}
else { else {
if (ch->modal) if (ch->modal)
group_modals = g_list_prepend(group_modals, ch); group_modals = g_list_prepend(group_modals, ch);
@ -266,8 +276,13 @@ static void restack_windows(ObClient *selected, gboolean raise)
} }
} }
/* put transients of the selected window right above it */ /* put modals above other direct transients */
wins = g_list_concat(modals, trans); wins = g_list_concat(modals, trans);
/* put helpers below direct transients */
wins = g_list_concat(wins, group_helpers);
/* put the selected window right below these children */
wins = g_list_append(wins, selected); wins = g_list_append(wins, selected);
/* if selected window is transient for group then raise it above others */ /* if selected window is transient for group then raise it above others */