]> git.sur5r.net Git - i3/i3/blobdiff - testcases/t/156-fullscreen-focus.t
Prevent moving out of fullscreen containers.
[i3/i3] / testcases / t / 156-fullscreen-focus.t
index f76588f9fa0faa60ac5d137bcb946037222e1717..af205c45732ffa5a5b33ecae78136bd97103e095 100644 (file)
@@ -111,7 +111,6 @@ $left = open_window;
 my $right1 = open_window;
 cmd 'split v';
 my $right2 = open_window;
-$nodes = get_ws_content($tmp);
 
 cmd 'focus parent';
 cmd 'fullscreen global';
@@ -234,4 +233,26 @@ is($x->input_focus, $right2->id, 'focus did not leave parent container (3)');
 cmd 'focus up';
 is($x->input_focus, $right22->id, 'focus did not leave parent container (4)');
 
+################################################################################
+# Ensure that moving in a direction doesn't violate the focus restrictions.
+################################################################################
+
+sub verify_move_prevented {
+    my $msg = shift;
+    my $nodes = get_ws_content($tmp2);
+    my $split = $nodes->[1];
+    my $fs = $split->{nodes}->[1];
+    is(scalar @{$fs->{nodes}}, 2, $msg);
+}
+
+cmd 'move left';
+verify_move_prevented('prevented move left');
+cmd 'move right';
+verify_move_prevented('prevented move right');
+cmd 'move down';
+verify_move_prevented('prevented move down');
+cmd 'move up';
+cmd 'move up';
+verify_move_prevented('prevented move up');
+
 done_testing;