2010-12-29 20:39:14 -05:00
|
|
|
#!perl
|
|
|
|
# vim:ts=4:sw=4:expandtab
|
|
|
|
#
|
2012-09-10 08:09:01 -04:00
|
|
|
# Please read the following documents before working on tests:
|
|
|
|
# • http://build.i3wm.org/docs/testsuite.html
|
|
|
|
# (or docs/testsuite)
|
|
|
|
#
|
|
|
|
# • http://build.i3wm.org/docs/lib-i3test.html
|
|
|
|
# (alternatively: perldoc ./testcases/lib/i3test.pm)
|
|
|
|
#
|
|
|
|
# • http://build.i3wm.org/docs/ipc.html
|
|
|
|
# (or docs/ipc)
|
|
|
|
#
|
|
|
|
# • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
|
|
|
|
# (unless you are already familiar with Perl)
|
|
|
|
#
|
2010-12-29 20:39:14 -05:00
|
|
|
# Regression: when resizing two containers on a workspace, opening a floating
|
|
|
|
# client, then closing it again, i3 will re-distribute the space on the
|
|
|
|
# workspace as if a tiling container was closed, leading to the containers
|
|
|
|
# taking much more space than they possibly could.
|
|
|
|
#
|
2011-03-09 14:25:17 -05:00
|
|
|
use i3test;
|
2010-12-29 20:39:14 -05:00
|
|
|
use List::Util qw(sum);
|
|
|
|
|
2011-03-09 14:25:17 -05:00
|
|
|
my $tmp = fresh_workspace;
|
2010-12-29 20:39:14 -05:00
|
|
|
|
2011-11-23 05:23:37 -05:00
|
|
|
my $first = open_window;
|
|
|
|
my $second = open_window;
|
|
|
|
|
2010-12-29 20:39:14 -05:00
|
|
|
my ($nodes, $focus) = get_ws_content($tmp);
|
|
|
|
my $old_sum = sum map { $_->{rect}->{width} } @{$nodes};
|
2011-11-23 05:23:37 -05:00
|
|
|
|
2010-12-29 20:39:14 -05:00
|
|
|
cmd 'resize grow left 10 px or 25 ppt';
|
|
|
|
cmd 'split v';
|
2011-11-23 05:23:37 -05:00
|
|
|
|
|
|
|
sync_with_i3;
|
|
|
|
|
|
|
|
my $third = open_window;
|
|
|
|
|
2010-12-29 20:39:14 -05:00
|
|
|
cmd 'mode toggle';
|
2011-11-23 05:23:37 -05:00
|
|
|
sync_with_i3;
|
2011-11-21 17:39:58 -05:00
|
|
|
|
2011-11-23 05:23:37 -05:00
|
|
|
cmd 'kill';
|
|
|
|
sync_with_i3;
|
2010-12-29 20:39:14 -05:00
|
|
|
|
|
|
|
($nodes, $focus) = get_ws_content($tmp);
|
|
|
|
my $new_sum = sum map { $_->{rect}->{width} } @{$nodes};
|
|
|
|
|
|
|
|
is($old_sum, $new_sum, 'combined container width is still equal');
|
2011-03-09 14:25:17 -05:00
|
|
|
|
|
|
|
done_testing;
|