]> git.sur5r.net Git - i3/i3/blob - testcases/t/144-regress-floating-resize.t
Merge pull request #2953 from CyberShadow/focus_wrapping
[i3/i3] / testcases / t / 144-regress-floating-resize.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 #
4 # Please read the following documents before working on tests:
5 # • https://build.i3wm.org/docs/testsuite.html
6 #   (or docs/testsuite)
7 #
8 # • https://build.i3wm.org/docs/lib-i3test.html
9 #   (alternatively: perldoc ./testcases/lib/i3test.pm)
10 #
11 # • https://build.i3wm.org/docs/ipc.html
12 #   (or docs/ipc)
13 #
14 # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
15 #   (unless you are already familiar with Perl)
16 #
17 # Regression: when resizing two containers on a workspace, opening a floating
18 # client, then closing it again, i3 will re-distribute the space on the
19 # workspace as if a tiling container was closed, leading to the containers
20 # taking much more space than they possibly could.
21 #
22 use i3test;
23 use List::Util qw(sum);
24
25 my $tmp = fresh_workspace;
26
27 my $first = open_window;
28 my $second = open_window;
29
30 my ($nodes, $focus) = get_ws_content($tmp);
31 my $old_sum = sum map { $_->{rect}->{width} } @{$nodes};
32
33 cmd 'resize grow left 10 px or 25 ppt';
34 cmd 'split v';
35
36 sync_with_i3;
37
38 my $third = open_window;
39
40 cmd 'mode toggle';
41 sync_with_i3;
42
43 cmd 'kill';
44 sync_with_i3;
45
46 ($nodes, $focus) = get_ws_content($tmp);
47 my $new_sum = sum map { $_->{rect}->{width} } @{$nodes};
48
49 is($old_sum, $new_sum, 'combined container width is still equal');
50
51 done_testing;