2 # vim:ts=4:sw=4:expandtab
4 # Test if the requested width/height is set after making the window floating.
8 my $tmp = fresh_workspace;
10 # Create a floating window which is smaller than the minimum enforced size of i3
11 my $window = open_window({ rect => [ 0, 0, 400, 150 ] });
13 my ($absolute, $top) = $window->rect;
15 ok($window->mapped, 'Window is mapped');
16 cmp_ok($absolute->{width}, '>', 400, 'i3 raised the width');
17 cmp_ok($absolute->{height}, '>', 150, 'i3 raised the height');
19 cmd 'floating toggle';
22 ($absolute, $top) = $window->rect;
24 diag('new width: ' . $absolute->{width});
25 diag('new height: ' . $absolute->{height});
27 # we compare with a tolerance of ± 20 pixels for borders in each direction
29 cmp_ok($absolute->{width}, '>', 400-20, 'width now > 380');
30 cmp_ok($absolute->{width}, '<', 400+20, 'width now < 420');
31 cmp_ok($absolute->{height}, '>', 150-20, 'height now > 130');
32 cmp_ok($absolute->{height}, '<', 150+20, 'height now < 170');
34 #cmp_ok($absolute->{width}, '>=', 75, 'i3 raised the width to 75');
35 #cmp_ok($absolute->{height}, '>=', 50, 'i3 raised the height to 50');