X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fstacking.c;h=ff5a943be9a03a4f1c870e978d545cbf76a0dcb6;hb=2c98204dfedafcf3d2fa010c1b6ac72110256c8c;hp=6050d0178e49880295a98f1001d5a03d764c59c0;hpb=8d034c6f4d676772ddc13a9824dc55a1aa499f2f;p=chaz%2Fopenbox diff --git a/openbox/stacking.c b/openbox/stacking.c index 6050d017..ff5a943b 100644 --- a/openbox/stacking.c +++ b/openbox/stacking.c @@ -1,6 +1,7 @@ /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*- stacking.c for the Openbox window manager + Copyright (c) 2006 Mikael Magnusson Copyright (c) 2003 Ben Jansens This program is free software; you can redistribute it and/or modify @@ -283,7 +284,8 @@ void stacking_raise(ObWindow *window, gboolean group) selected = WINDOW_AS_CLIENT(window); c = client_search_top_transient(selected); wins = pick_windows(c, selected, TRUE); - wins = g_list_concat(wins, pick_group_windows(c, selected, TRUE, group)); + wins = g_list_concat(wins, + pick_group_windows(c, selected, TRUE, group)); } else { wins = g_list_append(NULL, window); stacking_list = g_list_remove(stacking_list, window); @@ -302,7 +304,8 @@ void stacking_lower(ObWindow *window, gboolean group) selected = WINDOW_AS_CLIENT(window); c = client_search_top_transient(selected); wins = pick_windows(c, selected, FALSE); - wins = g_list_concat(pick_group_windows(c, selected, FALSE, group), wins); + wins = g_list_concat(pick_group_windows(c, selected, FALSE, group), + wins); } else { wins = g_list_append(NULL, window); stacking_list = g_list_remove(stacking_list, window); @@ -382,6 +385,15 @@ void stacking_add_nonintrusive(ObWindow *win) /* out of ideas, just add it normally... */ stacking_add(win); } else { + GList *it; + + /* make sure it's not in the wrong layer though ! */ + while (it_before && client->layer < ((ObClient*)it_before->data)->layer) + it_before = g_list_next(it_before); + while (it_before != stacking_list && + client->layer > ((ObClient*)g_list_previous(it_before)->data)->layer) + it_before = g_list_previous(it_before); + GList *wins = g_list_append(NULL, win); do_restack(wins, it_before); g_list_free(wins);