]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: 'level up' needs to stop at the workspace con + testcase (Thanks mseed)
authorMichael Stapelberg <michael@stapelberg.de>
Thu, 3 Mar 2011 13:30:13 +0000 (14:30 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Thu, 3 Mar 2011 13:30:13 +0000 (14:30 +0100)
src/tree.c
testcases/t/52-regress-level-up.t [new file with mode: 0644]

index 31177109302fec70e858d762efc1e8cd11633125..3c209fbc5a4fb9406c4601b305bd6dda3540b0b1 100644 (file)
@@ -268,8 +268,9 @@ void tree_split(Con *con, orientation_t orientation) {
  */
 void level_up() {
     /* We can focus up to the workspace, but not any higher in the tree */
-    if (focused->parent->type != CT_CON &&
-        focused->parent->type != CT_WORKSPACE) {
+    if ((focused->parent->type != CT_CON &&
+        focused->parent->type != CT_WORKSPACE) ||
+        focused->type == CT_WORKSPACE) {
         printf("cannot go up\n");
         return;
     }
diff --git a/testcases/t/52-regress-level-up.t b/testcases/t/52-regress-level-up.t
new file mode 100644 (file)
index 0000000..19b0f85
--- /dev/null
@@ -0,0 +1,21 @@
+#!perl
+# vim:ts=4:sw=4:expandtab
+#
+# Regression test for using level-up to get to the 'content'-container and
+# toggle floating
+#
+use Time::HiRes qw(sleep);
+use i3test;
+
+my $tmp = get_unused_workspace;
+cmd "workspace $tmp";
+
+
+cmd 'open';
+cmd 'level up';
+cmd 'level up';
+cmd 'mode toggle';
+
+does_i3_live;
+
+done_testing;