X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=openbox%2Fstacking.c;h=1638908bd55ffb3c13c83f1991197ea5b808b288;hb=cf033623a0f5519a42d13119db5e023ffe08a1ac;hp=92a5285d79f3a1ec22882868bbccd136fa5a7675;hpb=dd8cb753c16a902b46400eb4e80288cbaa25ba99;p=chaz%2Fopenbox diff --git a/openbox/stacking.c b/openbox/stacking.c index 92a5285d..1638908b 100644 --- a/openbox/stacking.c +++ b/openbox/stacking.c @@ -216,11 +216,21 @@ static void restack_windows(ObClient *selected, gboolean raise) GList *it, *last, *below, *above, *next; GList *wins = NULL; + GList *group_helpers = NULL; GList *group_modals = NULL; GList *group_trans = NULL; GList *modals = NULL; GList *trans = NULL; + if (raise) { + ObClient *p; + + /* if a window is modal for another single window, then raise it to the + top too, the same is done with the focus order */ + while (selected->modal && (p = client_direct_parent(selected))) + selected = p; + } + /* remove first so we can't run into ourself */ it = g_list_find(stacking_list, selected); g_assert(it); @@ -237,6 +247,8 @@ static void restack_windows(ObClient *selected, gboolean raise) /* only move windows in the same stacking 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)) { if (client_is_direct_child(selected, ch)) { @@ -245,6 +257,13 @@ static void restack_windows(ObClient *selected, gboolean raise) else 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 { if (ch->modal) group_modals = g_list_prepend(group_modals, ch); @@ -257,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); + + /* 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); /* if selected window is transient for group then raise it above others */