2 # vim:ts=4:sw=4:expandtab
4 use Test::More tests => 9;
8 use Time::HiRes qw(sleep);
10 use lib "$FindBin::Bin/lib";
14 use_ok('X11::XCB::Window');
17 X11::XCB::Connection->connect(':0');
19 # Create a floating window which is smaller than the minimum enforced size of i3
20 my $original_rect = X11::XCB::Rect->new(x => 0, y => 0, width => 30, height => 30);
22 my $window = X11::XCB::Window->new(
23 class => WINDOW_CLASS_INPUT_OUTPUT,
24 rect => $original_rect,
25 background_color => 12632256,
29 isa_ok($window, 'X11::XCB::Window');
36 my ($absolute, $top) = $window->rect;
38 ok($absolute->{width} >= 75, "i3 raised the width to 75");
39 ok($absolute->{height} >= 50, "i3 raised the height to 50");
41 ok($absolute->{x} != 0 && $absolute->{y} != 0, "i3 did not map it to (0x0)");
45 $original_rect = X11::XCB::Rect->new(x => 1, y => 1, width => 80, height => 90);
47 $window = X11::XCB::Window->new(
48 class => WINDOW_CLASS_INPUT_OUTPUT,
49 rect => $original_rect,
50 background_color => 12632256,
54 isa_ok($window, 'X11::XCB::Window');
61 ($absolute, $top) = $window->rect;
63 ok($absolute->{width} == 80, "i3 let the width at 80");
64 ok($absolute->{height} == 90, "i3 let the height at 90");
66 ok($top->{x} == 1 && $top->{y} == 1, "i3 mapped it to (1,1)");
70 diag( "Testing i3, Perl $], $^X" );