/* -*- 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
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);
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);
void stacking_add(ObWindow *win)
{
- ObStackingLayer l;
- GList *wins;
-
g_assert(screen_support_win != None); /* make sure I dont break this in the
future */
- l = window_layer(win);
- wins = g_list_append(NULL, win); /* list of 1 element */
-
stacking_list = g_list_append(stacking_list, win);
stacking_raise(win, FALSE);
}
/* 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);