]> git.sur5r.net Git - i3/i3/commitdiff
Merge pull request #2036 from Airblader/bug-2015
authorMichael Stapelberg <stapelberg@users.noreply.github.com>
Mon, 26 Oct 2015 08:14:28 +0000 (09:14 +0100)
committerMichael Stapelberg <stapelberg@users.noreply.github.com>
Mon, 26 Oct 2015 08:14:28 +0000 (09:14 +0100)
Make resize grow|shrink width|height work for a nested split in the s…

src/commands.c
testcases/t/141-resize.t

index f4436d1bbfb8ecf8a9f9a6f7af7b80a9fda64b7a..7aab6422522833eb3a889678f956bfeb01ce2a04 100644 (file)
@@ -615,7 +615,7 @@ static bool cmd_resize_tiling_width_height(I3_CMD, Con *current, const char *way
 
     while (current->type != CT_WORKSPACE &&
            current->type != CT_FLOATING_CON &&
-           con_orientation(current->parent) != search_orientation)
+           (con_orientation(current->parent) != search_orientation || con_num_children(current->parent) == 1))
         current = current->parent;
 
     /* get the default percentage */
index c5e61a328935404d4a3438ec6e275dca3efebc77..44ad9bbf97c2dfddb49e4fc2e3929098140d9aaa 100644 (file)
@@ -141,6 +141,21 @@ cmp_float($nodes->[1]->{percent}, 0.166666666666667, 'second window got 16%');
 cmp_float($nodes->[2]->{percent}, 0.166666666666667, 'third window got 16%');
 cmp_float($nodes->[3]->{percent}, 0.50, 'fourth window got 50%');
 
+################################################################################
+# Check that the resize grow/shrink width/height syntax works if a nested split
+# was set on the container, but no sibling has been opened yet. See #2015.
+################################################################################
+
+$tmp = fresh_workspace;
+$left = open_window;
+$right = open_window;
+
+cmd 'split h';
+cmd 'resize grow width 10px or 25 ppt';
+
+($nodes, $focus) = get_ws_content($tmp);
+cmp_float($nodes->[0]->{percent}, 0.25, 'left window got 25%');
+cmp_float($nodes->[1]->{percent}, 0.75, 'right window got 75%');
 
 ############################################################
 # checks that resizing floating windows works