more wip, first compile
authorDana Jansens <danakj@orodu.net>
Tue, 22 Dec 2009 14:59:37 +0000 (09:59 -0500)
committerDana Jansens <danakj@orodu.net>
Tue, 22 Dec 2009 16:44:52 +0000 (11:44 -0500)
openbox/actions/lower.c
openbox/actions/raise.c
openbox/stacking.c

index ad936aaba6b3614908efb0392b2b528f5ff59421..8a6c9473a0f5a04198ade564a1764b7671fb0302 100644 (file)
@@ -21,8 +21,8 @@ static gpointer setup_func(xmlNodePtr node)
 
     o = g_new0(Options, 1);
 
-    if ((n = obt_parse_find_node(node, "app")))
-        o->app = obt_parse_node_bool(n);
+    if ((n = obt_xml_find_node(node, "app")))
+        o->app = obt_xml_node_bool(n);
     return o;
 }
 
index cb789408558d4575bf3402c05789e0e1f132bf4a..24b3ecf3ea7b1e6623f3e378e53ead18f7af3cf7 100644 (file)
@@ -21,8 +21,8 @@ static gpointer setup_func(xmlNodePtr node)
 
     o = g_new0(Options, 1);
 
-    if ((n = obt_parse_find_node(node, "app")))
-        o->app = obt_parse_node_bool(n);
+    if ((n = obt_xml_find_node(node, "app")))
+        o->app = obt_xml_node_bool(n);
     return o;
 }
 
index a93ad6adb4c2ea508449742599bf6dc7052d8e30..147e7a98a655f2d775ac21edbd5b28c4e6772da3 100644 (file)
@@ -226,15 +226,15 @@ static void do_lower(GList *wins)
 */
 GList* find_top_of_layer(ObStackingLayer layer)
 {
-    GList *top;
+    GList *top, *it;
 
-    *top = NULL;
+    top = NULL;
     /* start from the bottom of the list and go up */
     for (it = g_list_last(stacking_list); it; it = g_list_previous(it))
     {
         if (window_layer(it->data) > layer)
             break;
-        *top = it;
+        top = it;
     }
     return top;
 }
@@ -386,7 +386,7 @@ static GList* get_app_windows(ObClient *selected)
         next = g_list_previous(it);
 
         if (WINDOW_IS_CLIENT(it->data) &&
-            client_is_in_application(WINDOW_AS_CLIENT(it->data)))
+            client_is_in_application(WINDOW_AS_CLIENT(it->data), selected))
         {
             stacking_list = g_list_remove_link(stacking_list, it);
             app = g_list_concat(it, app);
@@ -397,64 +397,59 @@ static GList* get_app_windows(ObClient *selected)
 
 static void restack_windows(ObClient *selected, gboolean raise, gboolean app)
 {
-    GList *wins, *direct, *app_trans, *parents;
+    GList *wins, *direct, *group_trans, *parents;
     GList *app_members = NULL;
 
     GList *it, *next, *direct_below, *group_trans_below, *between;
 
     /* get the restacking order for the selected window and its relatives */
-    get_restack_order(selected, raise, &direct, &app_trans);
+    get_restack_order(selected, raise, &direct, &group_trans);
 
     /* stick the selected window and all its direct-relations above this
        spot */
     direct_below = find_top_of_layer(raise ?
                                      selected->layer : selected->layer - 1);
 
-    /* WHERE DO THE APP WINDOWS GO EXACTLY???  AND THE GROUP TRANSIENTS?
-
-    THE BETWEEN WINDOWS ARE BETWEEN WHICH GROUPS OF WINDOWS ? */
-
-    if (app) {
-        app_members = get_app_windows(selected);
-        app_below = direct_below;
-    }
-    else {
-        app_members = NULL;
-        app_below = direct_below;
-
-        if (selected->group) {
-            /* find the highest member of @selected's group */
-            it = app_below;
-            for (it = g_list_previous(it); it; it = g_list_previous(it))
-                if (window_layer(it->data) > selected->layer)
-                    break;
-            if (WINDOW_IS_CLIENT(it->data)) {
-                ObClient *c = WINDOW_AS_CLIENT(it->data);
-                if (c->group == selected->group)
-                    app_below = it;
-            }
+    /* stick the group transients just above the highest group member left
+       in the stacking order (or else just above the direct windows */
+    group_trans_below = direct_below;
+    if (selected->group) {
+        /* find the highest member of @selected's group */
+        it = group_trans_below;
+        for (it = g_list_previous(it); it; it = g_list_previous(it))
+            if (window_layer(it->data) > selected->layer)
+                break;
+        if (WINDOW_IS_CLIENT(it->data)) {
+            ObClient *c = WINDOW_AS_CLIENT(it->data);
+            if (c->group == selected->group)
+                group_trans_below = it;
         }
     }
+    else
+        g_assert(group_trans == NULL);
 
-    /* stick the application transients directly above the other left-over
-       application windows */
-    app_members = g_list_concat(app_trans, app_members);
-
-    /* grab all the stuff between app_below and direct_below */
+    /* grab all the stuff between group_trans_below and direct_below */
     between = NULL;
-    for (it = direct_below; it && it != app_below; it = next) {
+    for (it = direct_below; it && it != group_trans_below; it = next) {
         next = g_list_previous(it);
         stacking_list = g_list_remove_link(stacking_list, it);
         between = g_list_concat(it, between);
     }
 
-    /* stick them all together and restack */
-    if (raise)
-        /* app_members, between, direct, below */
-        do_restack(g_list_concat(app_members, g_list_concat(between, direct)),
-                   below);
+    /* find any remaining app windows */
+    if (app)
+        app_members = get_app_windows(selected);
     else
-        do_restack(g_list_concat(
+        app_members = NULL;
+
+    /* stick them all together (group_trans, between, direct, app_members) */
+    direct = g_list_concat(group_trans,
+                           g_list_concat(between,
+                                         g_list_concat(direct, app_members)));
+    group_trans = between = app_members = NULL;
+
+    /* restack them */
+    do_restack(direct, direct_below);
 }
 
 void stacking_raise_app(ObClient *client)