gri3-wm/testcases/t/45-flattening.t

35 lines
986 B
Raku
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#!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);
use i3test;
my $x = X11::XCB::Connection->new;
my $tmp = fresh_workspace;
my $left = open_standard_window($x);
sleep 0.25;
my $mid = open_standard_window($x);
sleep 0.25;
my $right = open_standard_window($x);
sleep 0.25;
cmd 'move before v';
cmd 'move after h';
my $ws = get_ws($tmp);
is($ws->{orientation}, 'horizontal', 'workspace orientation is horizontal');
is(@{$ws->{nodes}}, 3, 'all three windows on workspace level');
done_testing;