2011-01-07 16:21:41 -05:00
|
|
|
|
#!perl
|
|
|
|
|
# vim:ts=4:sw=4:expandtab
|
|
|
|
|
#
|
|
|
|
|
# by moving the window in the opposite orientation that its parent has, we
|
|
|
|
|
# force i3 to create a new split container with the appropriate orientation.
|
|
|
|
|
# However, when doing that two times in a row, we end up with two split
|
|
|
|
|
# containers which are then redundant (workspace is horizontal, then v-split,
|
|
|
|
|
# then h-split – we could just append the children of the latest h-split to the
|
|
|
|
|
# workspace itself).
|
|
|
|
|
#
|
|
|
|
|
# This testcase checks that the tree is properly flattened after moving.
|
|
|
|
|
#
|
|
|
|
|
use X11::XCB qw(:all);
|
2011-03-09 14:25:17 -05:00
|
|
|
|
use i3test;
|
2011-01-07 16:21:41 -05:00
|
|
|
|
|
|
|
|
|
my $x = X11::XCB::Connection->new;
|
|
|
|
|
|
2011-03-09 14:25:17 -05:00
|
|
|
|
my $tmp = fresh_workspace;
|
2011-01-07 16:21:41 -05:00
|
|
|
|
|
2011-09-24 10:11:37 -04:00
|
|
|
|
my $left = open_window($x);
|
|
|
|
|
my $mid = open_window($x);
|
|
|
|
|
my $right = open_window($x);
|
2011-01-07 16:21:41 -05:00
|
|
|
|
|
2011-11-21 13:54:20 -05:00
|
|
|
|
cmd 'move up';
|
|
|
|
|
cmd 'move right';
|
2011-01-07 16:21:41 -05:00
|
|
|
|
my $ws = get_ws($tmp);
|
|
|
|
|
|
|
|
|
|
is($ws->{orientation}, 'horizontal', 'workspace orientation is horizontal');
|
|
|
|
|
is(@{$ws->{nodes}}, 3, 'all three windows on workspace level');
|
2011-03-09 14:25:17 -05:00
|
|
|
|
|
|
|
|
|
done_testing;
|