2010-07-17 01:27:47 +02: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 20:25:17 +01:00
|
|
|
use i3test;
|
2010-07-17 01:27:47 +02:00
|
|
|
|
|
|
|
my $i3 = i3("/tmp/nestedcons");
|
|
|
|
|
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-03-09 20:25:17 +01:00
|
|
|
cmd 'next v';
|
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-03-09 20:25:17 +01:00
|
|
|
cmd 'prev v';
|
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-03-09 20:25:17 +01:00
|
|
|
cmd 'level up';
|
|
|
|
cmd 'split h';
|
|
|
|
cmd 'level down';
|
2010-07-17 01:27:47 +02:00
|
|
|
|
2011-03-09 20:25:17 +01:00
|
|
|
cmd 'next v';
|
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-03-09 20:25:17 +01:00
|
|
|
cmd 'prev v';
|
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;
|