X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fstacking.c;h=405b7bd4546e08e772a07a23bde4cb8171e291b5;hb=4eb9a0c59efb6bfd598e35fe692e6b4b994e499c;hp=2a34f71dc4eea10305c1037a0ae24b64d9d4025b;hpb=4bf6b1b551be744be4fbe4d1faab5be12d051378;p=chaz%2Fopenbox diff --git a/openbox/stacking.c b/openbox/stacking.c index 2a34f71d..405b7bd4 100644 --- a/openbox/stacking.c +++ b/openbox/stacking.c @@ -218,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; @@ -248,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)) { @@ -256,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); @@ -268,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 */ @@ -423,8 +438,11 @@ void stacking_add(ObWindow *win) { g_assert(screen_support_win != None); /* make sure I dont break this in the future */ + /* don't add windows that are being unmanaged ! */ + if (WINDOW_IS_CLIENT(win)) g_assert(WINDOW_AS_CLIENT(win)->managed); stacking_list = g_list_append(stacking_list, win); + stacking_raise(win); } @@ -483,6 +501,9 @@ void stacking_add_nonintrusive(ObWindow *win) client = WINDOW_AS_CLIENT(win); + /* don't add windows that are being unmanaged ! */ + g_assert(client->managed); + /* insert above its highest parent (or its highest child !) */ it_below = find_highest_relative(client);