+ ret = g_list_concat((raise ? modal_sel : modals),
+ (raise ? modals : modal_sel));
+
+ ret = g_list_concat(ret, (raise ? trans_sel : trans));
+ ret = g_list_concat(ret, (raise ? trans : trans_sel));
+
+
+ /* add itself */
+ ret = g_list_append(ret, top);
+
+ return ret;
+}
+
+#if 0
+static GList *pick_group_windows(ObClient *top, ObClient *selected,
+ gboolean raise)
+{
+ GList *ret = NULL;
+ GList *it, *next, *prev;
+ GSList *sit;
+ int i, n;
+
+ /* add group members in their stacking order */
+ if (top->group) {
+ i = 0;
+ n = g_slist_length(top->group->members) - 1;
+ for (it = stacking_list; i < n && it; it = next) {
+ prev = g_list_previous(it);
+ next = g_list_next(it);
+
+ if ((sit = g_slist_find(top->group->members, it->data))) {
+ ++i;
+ ret = g_list_concat(ret,
+ pick_windows(sit->data, selected, raise));
+ /* if we dont have a prev then start back at the beginning,
+ otherwise skip back to the prev's next */
+ next = prev ? g_list_next(prev) : stacking_list;
+ }
+ }
+ }
+ return ret;
+}
+#endif
+
+void stacking_raise(ObWindow *window)
+{
+ GList *wins;
+
+ if (WINDOW_IS_CLIENT(window)) {
+ ObClient *c;
+ ObClient *selected;
+ 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));*/
+ } else {
+ wins = g_list_append(NULL, window);
+ stacking_list = g_list_remove(stacking_list, window);
+ }
+ do_raise(wins);
+ g_list_free(wins);
+}
+
+void stacking_lower(ObWindow *window)
+{
+ GList *wins;
+
+ if (WINDOW_IS_CLIENT(window)) {
+ ObClient *c;
+ ObClient *selected;
+ 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), wins);*/
+ } else {
+ wins = g_list_append(NULL, window);
+ stacking_list = g_list_remove(stacking_list, window);
+ }
+ do_lower(wins);
+ g_list_free(wins);