2010-07-17 01:27:47 +02:00
|
|
|
#!perl
|
|
|
|
# vim:ts=4:sw=4:expandtab
|
|
|
|
#
|
2012-09-10 14:09:01 +02: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-17 01:27:47 +02:00
|
|
|
# Check if stacking containers can be used independantly of
|
|
|
|
# the split mode (horizontal/vertical) of the underlying
|
|
|
|
# container.
|
|
|
|
#
|
2011-03-09 20:25:17 +01:00
|
|
|
use i3test;
|
2010-07-17 01:27:47 +02:00
|
|
|
|
2011-07-25 13:35:56 +02:00
|
|
|
my $i3 = i3(get_socket_path());
|
2010-07-17 01:27:47 +02:00
|
|
|
|
2011-03-09 20:25:17 +01:00
|
|
|
my $tmp = fresh_workspace;
|
2010-07-17 01:27:47 +02:00
|
|
|
|
|
|
|
ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
|
|
|
|
|
|
|
|
# Enforce vertical split mode
|
2011-03-09 20:25:17 +01:00
|
|
|
cmd 'split v';
|
2010-07-17 01:27:47 +02:00
|
|
|
|
2010-07-17 15:52:22 +02:00
|
|
|
my $first = open_empty_con($i3);
|
|
|
|
my $second = open_empty_con($i3);
|
2010-07-17 01:27:47 +02:00
|
|
|
|
|
|
|
isnt($first, $second, 'two different containers opened');
|
|
|
|
|
|
|
|
##############################################################
|
|
|
|
# change mode to stacking and cycle through the containers
|
|
|
|
##############################################################
|
|
|
|
|
2011-03-09 20:25:17 +01:00
|
|
|
cmd 'layout stacking';
|
2010-11-28 21:28:44 +01:00
|
|
|
is(get_focused($tmp), $second, 'second container still focused');
|
2010-07-17 01:27:47 +02:00
|
|
|
|
2011-06-08 20:49:49 +02:00
|
|
|
cmd 'focus down';
|
2010-11-28 21:28:44 +01:00
|
|
|
is(get_focused($tmp), $first, 'first container focused');
|
2010-07-17 01:27:47 +02:00
|
|
|
|
2011-06-08 20:49:49 +02:00
|
|
|
cmd 'focus up';
|
2010-11-28 21:28:44 +01:00
|
|
|
is(get_focused($tmp), $second, 'second container focused again');
|
2010-07-17 01:27:47 +02:00
|
|
|
|
|
|
|
##############################################################
|
|
|
|
# now change the orientation to horizontal and cycle
|
|
|
|
##############################################################
|
|
|
|
|
2011-06-10 01:36:33 +02:00
|
|
|
cmd 'focus parent';
|
2011-03-09 20:25:17 +01:00
|
|
|
cmd 'split h';
|
2011-06-10 01:36:33 +02:00
|
|
|
cmd 'focus child';
|
2010-07-17 01:27:47 +02:00
|
|
|
|
2011-06-08 20:49:49 +02:00
|
|
|
cmd 'focus down';
|
2010-11-28 21:28:44 +01:00
|
|
|
is(get_focused($tmp), $first, 'first container focused');
|
2010-07-17 01:27:47 +02:00
|
|
|
|
2011-06-08 20:49:49 +02:00
|
|
|
cmd 'focus up';
|
2010-11-28 21:28:44 +01:00
|
|
|
is(get_focused($tmp), $second, 'second container focused again');
|
2010-07-17 01:27:47 +02:00
|
|
|
|
|
|
|
|
2011-03-09 20:25:17 +01:00
|
|
|
done_testing;
|