summaryrefslogtreecommitdiff
path: root/openbox/stacking.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-03-11 14:16:24 +0000
committerDana Jansens <danakj@orodu.net>2007-03-11 14:16:24 +0000
commit6a61f0c433eeecfb289ab6c9db635e25958a6340 (patch)
treed49dbd831bdcf512161efb18768b9627bb2fddbc /openbox/stacking.c
parentaaabb13c0a1c41b6b20ea75df707671569fb08ab (diff)
fix non instrusive stacking adds, they didnt account for layers at all
Diffstat (limited to 'openbox/stacking.c')
-rw-r--r--openbox/stacking.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/openbox/stacking.c b/openbox/stacking.c
index 29b3d1a9..ff5a943b 100644
--- a/openbox/stacking.c
+++ b/openbox/stacking.c
@@ -385,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);