X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fstacking.c;h=cb710e5e0f8940a4be76fba10058be00623b4028;hb=acafa38c8ea210b12ed92fc16281b915ab61542c;hp=3c05df49c64c0c23f470a87aa4e090ee33fb4d29;hpb=ceb77efdd44e993b1ed4e9d908f93baf22b2b22c;p=chaz%2Fopenbox diff --git a/openbox/stacking.c b/openbox/stacking.c index 3c05df49..cb710e5e 100644 --- a/openbox/stacking.c +++ b/openbox/stacking.c @@ -69,6 +69,8 @@ static void do_restack(GList *wins, GList *before) #ifdef DEBUG GList *next; + + g_assert(wins); /* pls only restack stuff in the same layer at a time */ for (it = wins; it; it = next) { next = g_list_next(it); @@ -216,6 +218,7 @@ 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; @@ -246,6 +249,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)) { @@ -254,6 +259,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); @@ -266,8 +278,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 */