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.
|
|
|
|
#
|
|
|
|
use i3test tests => 7;
|
|
|
|
use Time::HiRes qw(sleep);
|
|
|
|
|
|
|
|
my $i3 = i3("/tmp/nestedcons");
|
|
|
|
|
|
|
|
my $tmp = get_unused_workspace();
|
|
|
|
$i3->command("workspace $tmp")->recv;
|
|
|
|
|
|
|
|
ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
|
|
|
|
|
|
|
|
# Enforce vertical split mode
|
|
|
|
$i3->command('split v')->recv;
|
|
|
|
|
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
|
|
|
|
##############################################################
|
|
|
|
|
|
|
|
$i3->command('layout stacking')->recv;
|
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
|
|
|
|
|
|
|
$i3->command('next v')->recv;
|
2010-11-28 21:28:44 +01:00
|
|
|
is(get_focused($tmp), $first, 'first container focused');
|
2010-07-17 01:27:47 +02:00
|
|
|
|
|
|
|
$i3->command('prev v')->recv;
|
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
|
|
|
|
##############################################################
|
|
|
|
|
|
|
|
$i3->command('level up')->recv;
|
|
|
|
$i3->command('split h')->recv;
|
|
|
|
$i3->command('level down')->recv;
|
|
|
|
|
|
|
|
$i3->command('next v')->recv;
|
2010-11-28 21:28:44 +01:00
|
|
|
is(get_focused($tmp), $first, 'first container focused');
|
2010-07-17 01:27:47 +02:00
|
|
|
|
|
|
|
$i3->command('prev v')->recv;
|
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
|
|
|
|
|
|
|
|
|
|
|
diag( "Testing i3, Perl $], $^X" );
|