2 # vim:ts=4:sw=4:expandtab
4 # Test to see if i3 combines the geometry of all children in a split container
5 # when setting the split container to floating
9 my $tmp = fresh_workspace;
11 #####################################################################
12 # open a window with 200x80
13 #####################################################################
15 my $first = open_window({
16 rect => [ 0, 0, 200, 80],
17 background_color => '#FF0000',
20 #####################################################################
21 # Open a second window with 300x90
22 #####################################################################
24 my $second = open_window({
25 rect => [ 0, 0, 300, 90],
26 background_color => '#00FF00',
29 #####################################################################
30 # Set the parent to floating
31 #####################################################################
32 cmd 'nop setting floating';
34 cmd 'floating enable';
36 #####################################################################
37 # Get geometry of the first floating node (the split container)
38 #####################################################################
40 my @nodes = @{get_ws($tmp)->{floating_nodes}};
41 my $rect = $nodes[0]->{rect};
43 # we compare the width with ± 20 pixels for borders
44 cmp_ok($rect->{width}, '>', 500-20, 'width now > 480');
45 cmp_ok($rect->{width}, '<', 500+20, 'width now < 520');
46 # we compare the height with ± 40 pixels for decorations
47 cmp_ok($rect->{height}, '>', 90-40, 'width now > 50');
48 cmp_ok($rect->{height}, '<', 90+40, 'width now < 130');