2 # vim:ts=4:sw=4:expandtab
4 use Test::More tests => 10;
8 use Time::HiRes qw(sleep);
10 use lib "$FindBin::Bin/lib";
14 use_ok('X11::XCB::Window');
17 my $x = X11::XCB::Connection->new;
19 # Create a floating window which is smaller than the minimum enforced size of i3
20 my $window = $x->root->create_child(
21 class => WINDOW_CLASS_INPUT_OUTPUT,
22 rect => [ 0, 0, 30, 30],
23 background_color => '#C0C0C0',
24 # replace the type with 'utility' as soon as the coercion works again in X11::XCB
25 type => $x->atom(name => '_NET_WM_WINDOW_TYPE_UTILITY'),
28 isa_ok($window, 'X11::XCB::Window');
34 my ($absolute, $top) = $window->rect;
36 ok($window->mapped, 'Window is mapped');
37 ok($absolute->{width} >= 75, 'i3 raised the width to 75');
38 ok($absolute->{height} >= 50, 'i3 raised the height to 50');
40 ok($absolute->{x} != 0 && $absolute->{y} != 0, 'i3 did not map it to (0x0)');
44 $window = $x->root->create_child(
45 class => WINDOW_CLASS_INPUT_OUTPUT,
46 rect => [ 1, 1, 80, 90],
47 background_color => '#C0C0C0',
48 type => $x->atom(name => '_NET_WM_WINDOW_TYPE_UTILITY'),
51 isa_ok($window, 'X11::XCB::Window');
57 ($absolute, $top) = $window->rect;
59 ok($absolute->{width} == 80, "i3 let the width at 80");
60 ok($absolute->{height} == 90, "i3 let the height at 90");
62 ok($top->{x} == 1 && $top->{y} == 1, "i3 mapped it to (1,1)");
66 diag( "Testing i3, Perl $], $^X" );