2 # vim:ts=4:sw=4:expandtab
4 # Checks if size hints are interpreted correctly.
7 use Time::HiRes qw(sleep);
9 my $i3 = i3("/tmp/nestedcons");
11 my $x = X11::XCB::Connection->new;
13 my $tmp = get_unused_workspace();
14 $i3->command("workspace $tmp")->recv;
16 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
18 my $win = $x->root->create_child(
19 class => WINDOW_CLASS_INPUT_OUTPUT,
20 rect => X11::XCB::Rect->new(x => 0, y => 0, width => 30, height => 30),
21 background_color => '#C0C0C0',
24 # XXX: we should check screen size. in screens with an AR of 2.0,
25 # this is not a good idea.
26 my $aspect = X11::XCB::Sizehints::Aspect->new;
27 $aspect->min_num(600);
28 $aspect->min_den(300);
29 $aspect->max_num(600);
30 $aspect->max_den(300);
34 $win->hints->aspect($aspect);
39 my $rect = $win->rect;
40 my $ar = $rect->width / $rect->height;
41 diag("Aspect ratio = $ar");
42 ok(($ar > 1.90) && ($ar < 2.10), 'Aspect ratio about 2.0');
44 diag( "Testing i3, Perl $], $^X" );