]> git.sur5r.net Git - i3/i3/blobdiff - src/cmdparse.y
Bugfix: Fix 'resize' command in nested containers (Thanks mseed)
[i3/i3] / src / cmdparse.y
index d319bb3f0974e5ac0532be5e531f8201da3da510..092bea2d8ee6f5a9626d8f7ca5c0141c40ff7f30 100644 (file)
@@ -967,6 +967,16 @@ resize:
             while (current->parent->layout == L_STACKED ||
                    current->parent->layout == L_TABBED)
                 current = current->parent;
+
+            /* Then further go up until we find one with the matching orientation. */
+            orientation_t search_orientation =
+                (direction == TOK_LEFT || direction == TOK_RIGHT ? HORIZ : VERT);
+
+            while (current->type != CT_WORKSPACE &&
+                   current->type != CT_FLOATING_CON &&
+                   current->parent->orientation != search_orientation)
+                current = current->parent;
+
             /* get the default percentage */
             int children = con_num_children(current->parent);
             Con *other;