2 # vim:ts=4:sw=4:expandtab
4 # Checks if size hints are interpreted correctly.
8 my $i3 = i3(get_socket_path());
10 my $x = X11::XCB::Connection->new;
12 my $tmp = fresh_workspace;
14 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
16 my $win = $x->root->create_child(
17 class => WINDOW_CLASS_INPUT_OUTPUT,
18 rect => X11::XCB::Rect->new(x => 0, y => 0, width => 30, height => 30),
19 background_color => '#C0C0C0',
22 # XXX: we should check screen size. in screens with an AR of 2.0,
23 # this is not a good idea.
24 my $aspect = X11::XCB::Sizehints::Aspect->new;
25 $aspect->min_num(600);
26 $aspect->min_den(300);
27 $aspect->max_num(600);
28 $aspect->max_den(300);
32 $win->hints->aspect($aspect);
37 my $rect = $win->rect;
38 my $ar = $rect->width / $rect->height;
39 diag("Aspect ratio = $ar");
40 ok(($ar > 1.90) && ($ar < 2.10), 'Aspect ratio about 2.0');