2 # vim:ts=4:sw=4:expandtab
6 use Time::HiRes qw(sleep);
7 use List::Util qw(first);
10 use_ok('X11::XCB::Connection') or BAIL_OUT('Cannot load X11::XCB::Connection');
13 my $x = X11::XCB::Connection->new;
15 #####################################################################
16 # Create a dock window and see if it gets managed
17 #####################################################################
19 my $screens = $x->screens;
21 # Get the primary screen
22 my $primary = first { $_->primary } @{$screens};
24 # TODO: focus the primary screen before
26 my $window = $x->root->create_child(
27 class => WINDOW_CLASS_INPUT_OUTPUT,
28 rect => [ 0, 0, 30, 30],
29 background_color => '#FF0000',
30 type => $x->atom(name => '_NET_WM_WINDOW_TYPE_DOCK'),
37 my $rect = $window->rect;
38 is($rect->width, $primary->rect->width, 'dock client is as wide as the screen');
40 my $fwindow = $x->root->create_child(
41 class => WINDOW_CLASS_INPUT_OUTPUT,
42 rect => [ 0, 0, 30, 30],
43 background_color => '#FF0000',
44 type => $x->atom(name => '_NET_WM_WINDOW_TYPE_DOCK'),
47 $fwindow->transient_for($window);
53 diag( "Testing i3, Perl $], $^X" );