2 # vim:ts=4:sw=4:expandtab
4 # Please read the following documents before working on tests:
5 # • https://build.i3wm.org/docs/testsuite.html
8 # • https://build.i3wm.org/docs/lib-i3test.html
9 # (alternatively: perldoc ./testcases/lib/i3test.pm)
11 # • https://build.i3wm.org/docs/ipc.html
14 # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
15 # (unless you are already familiar with Perl)
17 # Checks if size hints are interpreted correctly.
21 my $tmp = fresh_workspace;
23 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
25 my $win = open_window({ dont_map => 1 });
26 # XXX: we should check screen size. in screens with an AR of 2.0,
27 # this is not a good idea.
28 my $aspect = X11::XCB::Sizehints::Aspect->new;
29 $aspect->min_num(600);
30 $aspect->min_den(300);
31 $aspect->max_num(600);
32 $aspect->max_den(300);
36 $win->hints->aspect($aspect);
41 my $rect = $win->rect;
42 my $ar = $rect->width / $rect->height;
43 diag("Aspect ratio = $ar");
44 ok(($ar > 1.90) && ($ar < 2.10), 'Aspect ratio about 2.0');