]> git.sur5r.net Git - i3/i3/blobdiff - testcases/t/141-resize.t
Merge branch 'master' into next
[i3/i3] / testcases / t / 141-resize.t
index 18e28ccb76dd4bf1bec7cae0fb7049fc67fe250e..c2038060a707c3fd55ae09ec951381a098cd651a 100644 (file)
@@ -7,10 +7,8 @@ my $tmp = fresh_workspace;
 
 cmd 'split v';
 
-my $top = open_window($x);
-my $bottom = open_window($x);
-
-sync_with_i3($x);
+my $top = open_window;
+my $bottom = open_window;
 
 diag("top = " . $top->id . ", bottom = " . $bottom->id);
 
@@ -47,8 +45,8 @@ $tmp = fresh_workspace;
 
 cmd 'split v';
 
-$top = open_window($x);
-$bottom = open_window($x);
+$top = open_window;
+$bottom = open_window;
 
 cmd 'split h';
 cmd 'layout stacked';
@@ -63,13 +61,40 @@ cmd 'resize grow up 10 px or 25 ppt';
 is($nodes->[0]->{percent}, 0.25, 'top window got 25%');
 is($nodes->[1]->{percent}, 0.75, 'bottom window got 75%');
 
+############################################################
+# Checks that resizing in the parent's parent's orientation works.
+# Take for example a horizontal workspace with one window on the left side and
+# a v-split container with two windows on the right side. Focus is on the
+# bottom right window, use 'resize left'.
+############################################################
+
+$tmp = fresh_workspace;
+
+my $left = open_window;
+my $right = open_window;
+
+cmd 'split v';
+
+$top = open_window;
+$bottom = open_window;
+
+($nodes, $focus) = get_ws_content($tmp);
+is($nodes->[0]->{percent}, 0.5, 'left window got 50%');
+is($nodes->[1]->{percent}, 0.5, 'right window got 50%');
+
+cmd 'resize grow left 10 px or 25 ppt';
+
+($nodes, $focus) = get_ws_content($tmp);
+is($nodes->[0]->{percent}, 0.25, 'left window got 25%');
+is($nodes->[1]->{percent}, 0.75, 'right window got 75%');
+
 ############################################################
 # checks that resizing floating windows works
 ############################################################
 
 $tmp = fresh_workspace;
 
-$top = open_window($x);
+$top = open_window;
 
 cmd 'floating enable';