]> git.sur5r.net Git - i3/i3/blob - testcases/t/133-size-hints.t
Merge branch 'master' into next
[i3/i3] / testcases / t / 133-size-hints.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 #
4 # Checks if size hints are interpreted correctly.
5 #
6 use i3test;
7
8 my $tmp = fresh_workspace;
9
10 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
11
12 my $win = open_window({ dont_map => 1 });
13 # XXX: we should check screen size. in screens with an AR of 2.0,
14 # this is not a good idea.
15 my $aspect = X11::XCB::Sizehints::Aspect->new;
16 $aspect->min_num(600);
17 $aspect->min_den(300);
18 $aspect->max_num(600);
19 $aspect->max_den(300);
20 $win->_create;
21 $win->map;
22 wait_for_map $win;
23 $win->hints->aspect($aspect);
24 $x->flush;
25
26 sync_with_i3;
27
28 my $rect = $win->rect;
29 my $ar = $rect->width / $rect->height;
30 diag("Aspect ratio = $ar");
31 ok(($ar > 1.90) && ($ar < 2.10), 'Aspect ratio about 2.0');
32
33 done_testing;