Allow focus child/parent when in fullscreen.

This is now restricted according to the already defined fullscreen
focus constraints. Test case 157 was removed, as we don't prevent
level up/down in fullscreen anymore. Those commands are properly
tested in fullscreen by test case 156.

Fixes: #612
This commit is contained in:
Fernando Tarlá Cardoso Lemos
2012-05-26 18:36:25 -03:00
committed by Michael Stapelberg
parent da1e232757
commit 250c260eaa
6 changed files with 48 additions and 80 deletions

View File

@ -122,6 +122,12 @@ is($x->input_focus, $right1->id, 'upper right window focused');
cmd '[id="' . $right2->id . '"] focus';
is($x->input_focus, $right2->id, 'bottom right window focused');
cmd 'focus parent';
isnt($x->input_focus, $right2->id, 'bottom right window no longer focused');
cmd 'focus child';
is($x->input_focus, $right2->id, 'bottom right window focused again');
cmd '[id="' . $left->id . '"] focus';
is($x->input_focus, $right2->id, 'prevented focus change to left window');
@ -129,26 +135,26 @@ cmd '[id="' . $diff_ws->id . '"] focus';
is($x->input_focus, $right2->id, 'prevented focus change to different ws');
################################################################################
# Same tests when we're in non-global fullscreen mode. We toggle fullscreen on
# and off to avoid testing whether focus level works in fullscreen for now. It
# should now be possible to focus a container in a different workspace.
# Same tests when we're in non-global fullscreen mode. It should now be possible
# to focus a container in a different workspace.
################################################################################
cmd 'focus parent';
cmd 'fullscreen global';
cmd 'fullscreen global';
cmd 'fullscreen';
cmd '[id="' . $right1->id . '"] focus';
is($x->input_focus, $right1->id, 'upper right window focused');
cmd 'focus parent';
cmd 'fullscreen';
cmd '[id="' . $right1->id . '"] focus';
is($x->input_focus, $right1->id, 'upper right window still focused');
cmd '[id="' . $right2->id . '"] focus';
is($x->input_focus, $right2->id, 'bottom right window focused');
cmd 'focus parent';
isnt($x->input_focus, $right2->id, 'bottom right window no longer focused');
cmd 'focus child';
is($x->input_focus, $right2->id, 'bottom right window focused again');
cmd '[id="' . $left->id . '"] focus';
is($x->input_focus, $right2->id, 'prevented focus change to left window');

View File

@ -1,41 +0,0 @@
#!perl
# vim:ts=4:sw=4:expandtab
#
# Regression test: level up should be a noop during fullscreen mode
#
use i3test;
my $tmp = fresh_workspace;
#####################################################################
# open a window, verify its not in fullscreen mode
#####################################################################
my $win = open_window;
my $nodes = get_ws_content $tmp;
is(@$nodes, 1, 'exactly one client');
is($nodes->[0]->{fullscreen_mode}, 0, 'client not fullscreen');
#####################################################################
# make it fullscreen
#####################################################################
cmd 'nop making fullscreen';
cmd 'fullscreen';
$nodes = get_ws_content $tmp;
is($nodes->[0]->{fullscreen_mode}, 1, 'client fullscreen now');
#####################################################################
# send level up, try to un-fullscreen
#####################################################################
cmd 'focus parent';
cmd 'fullscreen';
$nodes = get_ws_content $tmp;
is($nodes->[0]->{fullscreen_mode}, 0, 'client not fullscreen any longer');
does_i3_live;
done_testing;