]> Dogcows Code - chaz/openbox/blobdiff - openbox/stacking.c
update changelog for 3.4.1 so far
[chaz/openbox] / openbox / stacking.c
index b6e81dbf5e3adce2eb53b29bcf60037cd76b8302..afd890a4825dd3878f52c2b733d9b45bc284dc0c 100644 (file)
@@ -169,7 +169,7 @@ static void restack_windows(ObClient *selected, gboolean raise)
     GList *modals = NULL;
     GList *trans = NULL;
 
-    if (!raise && selected->transient_for) {
+    if (!raise && selected->parents) {
         GSList *top, *top_it;
         GSList *top_reorder = NULL;
         
@@ -179,6 +179,11 @@ static void restack_windows(ObClient *selected, gboolean raise)
 
         /* that is, if it has any parents */
         if (!(top->data == selected && top->next == NULL)) {
+            /* place the window being lowered on the bottom so it'll be
+               below any of its peers that it can */
+            stacking_list = g_list_remove(stacking_list, selected);
+            stacking_list = g_list_append(stacking_list, selected);
+
             /* go thru stacking list backwards so we can use g_slist_prepend */
             for (it = g_list_last(stacking_list); it && top;
                  it = g_list_previous(it))
@@ -233,7 +238,7 @@ static void restack_windows(ObClient *selected, gboolean raise)
     wins = g_list_append(wins, selected);
 
     /* if selected window is transient for group then raise it above others */
-    if (selected->transient_for == OB_TRAN_GROUP) {
+    if (selected->transient_for_group) {
         /* if it's modal, raise it above those also */
         if (selected->modal) {
             wins = g_list_concat(wins, group_modals);
@@ -371,7 +376,7 @@ static GList *find_highest_relative(ObClient *client)
 {    
     GList *ret = NULL;
 
-    if (client->transient_for) {
+    if (client->parents) {
         GList *it;
         GSList *top;
 
@@ -382,8 +387,14 @@ static GList *find_highest_relative(ObClient *client)
         for (it = stacking_list; !ret && it; it = g_list_next(it)) {
             if (WINDOW_IS_CLIENT(it->data)) {
                 ObClient *c = it->data;
-                /* only look at windows in the same layer */
-                if (c->layer == client->layer) {
+                /* only look at windows in the same layer and that are
+                   visible */
+                if (c->layer == client->layer &&
+                    !c->iconic && 
+                    (c->desktop == client->desktop ||
+                     c->desktop == DESKTOP_ALL ||
+                     client->desktop == DESKTOP_ALL))
+                {
                     GSList *sit;
 
                     /* go through each top level parent and see it this window
This page took 0.026313 seconds and 4 git commands to generate.