2010-07-16 19:27:47 -04:00
|
|
|
#!perl
|
|
|
|
# vim:ts=4:sw=4:expandtab
|
|
|
|
#
|
2012-09-10 08:09:01 -04:00
|
|
|
# Please read the following documents before working on tests:
|
|
|
|
# • http://build.i3wm.org/docs/testsuite.html
|
|
|
|
# (or docs/testsuite)
|
|
|
|
#
|
|
|
|
# • http://build.i3wm.org/docs/lib-i3test.html
|
|
|
|
# (alternatively: perldoc ./testcases/lib/i3test.pm)
|
|
|
|
#
|
|
|
|
# • http://build.i3wm.org/docs/ipc.html
|
|
|
|
# (or docs/ipc)
|
|
|
|
#
|
|
|
|
# • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
|
|
|
|
# (unless you are already familiar with Perl)
|
|
|
|
#
|
2010-07-16 19:27:47 -04:00
|
|
|
# Check if stacking containers can be used independantly of
|
|
|
|
# the split mode (horizontal/vertical) of the underlying
|
|
|
|
# container.
|
|
|
|
#
|
2011-03-09 14:25:17 -05:00
|
|
|
use i3test;
|
2010-07-16 19:27:47 -04:00
|
|
|
|
2011-07-25 07:35:56 -04:00
|
|
|
my $i3 = i3(get_socket_path());
|
2010-07-16 19:27:47 -04:00
|
|
|
|
2011-03-09 14:25:17 -05:00
|
|
|
my $tmp = fresh_workspace;
|
2010-07-16 19:27:47 -04:00
|
|
|
|
|
|
|
ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
|
|
|
|
|
|
|
|
# Enforce vertical split mode
|
2011-03-09 14:25:17 -05:00
|
|
|
cmd 'split v';
|
2010-07-16 19:27:47 -04:00
|
|
|
|
2010-07-17 09:52:22 -04:00
|
|
|
my $first = open_empty_con($i3);
|
|
|
|
my $second = open_empty_con($i3);
|
2010-07-16 19:27:47 -04:00
|
|
|
|
|
|
|
isnt($first, $second, 'two different containers opened');
|
|
|
|
|
|
|
|
##############################################################
|
|
|
|
# change mode to stacking and cycle through the containers
|
|
|
|
##############################################################
|
|
|
|
|
2011-03-09 14:25:17 -05:00
|
|
|
cmd 'layout stacking';
|
2010-11-28 15:28:44 -05:00
|
|
|
is(get_focused($tmp), $second, 'second container still focused');
|
2010-07-16 19:27:47 -04:00
|
|
|
|
2011-06-08 14:49:49 -04:00
|
|
|
cmd 'focus down';
|
2010-11-28 15:28:44 -05:00
|
|
|
is(get_focused($tmp), $first, 'first container focused');
|
2010-07-16 19:27:47 -04:00
|
|
|
|
2011-06-08 14:49:49 -04:00
|
|
|
cmd 'focus up';
|
2010-11-28 15:28:44 -05:00
|
|
|
is(get_focused($tmp), $second, 'second container focused again');
|
2010-07-16 19:27:47 -04:00
|
|
|
|
|
|
|
##############################################################
|
|
|
|
# now change the orientation to horizontal and cycle
|
|
|
|
##############################################################
|
|
|
|
|
2011-06-09 19:36:33 -04:00
|
|
|
cmd 'focus parent';
|
2011-03-09 14:25:17 -05:00
|
|
|
cmd 'split h';
|
2011-06-09 19:36:33 -04:00
|
|
|
cmd 'focus child';
|
2010-07-16 19:27:47 -04:00
|
|
|
|
2011-06-08 14:49:49 -04:00
|
|
|
cmd 'focus down';
|
2010-11-28 15:28:44 -05:00
|
|
|
is(get_focused($tmp), $first, 'first container focused');
|
2010-07-16 19:27:47 -04:00
|
|
|
|
2011-06-08 14:49:49 -04:00
|
|
|
cmd 'focus up';
|
2010-11-28 15:28:44 -05:00
|
|
|
is(get_focused($tmp), $second, 'second container focused again');
|
2010-07-16 19:27:47 -04:00
|
|
|
|
|
|
|
|
2011-03-09 14:25:17 -05:00
|
|
|
done_testing;
|