]> git.sur5r.net Git - i3/i3/blob - testcases/t/144-regress-floating-resize.t
testcases: fix race conditions in various tests
[i3/i3] / testcases / t / 144-regress-floating-resize.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 #
4 # Regression: when resizing two containers on a workspace, opening a floating
5 # client, then closing it again, i3 will re-distribute the space on the
6 # workspace as if a tiling container was closed, leading to the containers
7 # taking much more space than they possibly could.
8 #
9 use i3test;
10 use List::Util qw(sum);
11 use X11::XCB::Connection;
12
13 my $x = X11::XCB::Connection->new;
14
15 my $tmp = fresh_workspace;
16
17 cmd 'exec /usr/bin/urxvt';
18 wait_for_map $x;
19 cmd 'exec /usr/bin/urxvt';
20 wait_for_map $x;
21
22 my ($nodes, $focus) = get_ws_content($tmp);
23 my $old_sum = sum map { $_->{rect}->{width} } @{$nodes};
24 #cmd 'open';
25 cmd 'resize grow left 10 px or 25 ppt';
26 cmd 'split v';
27 #cmd 'open';
28 cmd 'exec /usr/bin/urxvt';
29 wait_for_map $x;
30
31 cmd 'mode toggle';
32 sync_with_i3 $x;
33
34 cmd 'kill';
35 wait_for_unmap $x;
36
37 ($nodes, $focus) = get_ws_content($tmp);
38 my $new_sum = sum map { $_->{rect}->{width} } @{$nodes};
39
40 is($old_sum, $new_sum, 'combined container width is still equal');
41
42 done_testing;