]> git.sur5r.net Git - i3/i3/commitdiff
Merge branch 'master' into next
authorMichael Stapelberg <michael@stapelberg.de>
Tue, 7 Feb 2012 22:42:58 +0000 (17:42 -0500)
committerMichael Stapelberg <michael@stapelberg.de>
Tue, 7 Feb 2012 22:42:58 +0000 (17:42 -0500)
src/tree.c
testcases/t/122-split.t

index 7e6321003ca260ddee8780110e7109ee38ecf853..5559908f0738d20afbbed8e9b5f048a7609a4e65 100644 (file)
@@ -350,7 +350,8 @@ void tree_split(Con *con, orientation_t orientation) {
     /* if we are in a container whose parent contains only one
      * child (its split functionality is unused so far), we just change the
      * orientation (more intuitive than splitting again) */
-    if (con_num_children(parent) == 1) {
+    if (con_num_children(parent) == 1 &&
+        parent->layout == L_DEFAULT) {
         parent->orientation = orientation;
         DLOG("Just changing orientation of existing container\n");
         return;
index 71736db462fd7e8d47400f5f25e4cf754d36d12e..702679ac41e734880fc2a951231b2d853c81dcfd 100644 (file)
@@ -88,4 +88,25 @@ cmd 'split v';
 my $count = sum_nodes(\@content);
 is($count, $old_count, 'not more windows after splitting again');
 
+######################################################################
+# In the special case of being inside a stacked or tabbed container, we don’t
+# want this to happen.
+######################################################################
+
+$tmp = fresh_workspace;
+
+cmd 'open';
+@content = @{get_ws_content($tmp)};
+is(scalar @content, 1, 'Precisely one container on this ws');
+cmd 'layout stacked';
+@content = @{get_ws_content($tmp)};
+is(scalar @content, 1, 'Still one container on this ws');
+is(scalar @{$content[0]->{nodes}}, 1, 'Stacked con has one child node');
+
+cmd 'split h';
+cmd 'open';
+@content = @{get_ws_content($tmp)};
+is(scalar @content, 1, 'Still one container on this ws');
+is(scalar @{$content[0]->{nodes}}, 1, 'Stacked con still has one child node');
+
 done_testing;