2010-07-16 19:27:47 -04:00
|
|
|
#!perl
|
|
|
|
# vim:ts=4:sw=4:expandtab
|
|
|
|
#
|
|
|
|
# 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
|
|
|
|
|
|
|
my $i3 = i3("/tmp/nestedcons");
|
|
|
|
|
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-03-09 14:25:17 -05:00
|
|
|
cmd 'next v';
|
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-03-09 14:25:17 -05:00
|
|
|
cmd 'prev v';
|
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-03-09 14:25:17 -05:00
|
|
|
cmd 'level up';
|
|
|
|
cmd 'split h';
|
|
|
|
cmd 'level down';
|
2010-07-16 19:27:47 -04:00
|
|
|
|
2011-03-09 14:25:17 -05:00
|
|
|
cmd 'next v';
|
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-03-09 14:25:17 -05:00
|
|
|
cmd 'prev v';
|
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;
|