*/
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;
}
--- /dev/null
+#!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;