2009-08-21 06:32:54 -04:00
|
|
|
#!perl
|
|
|
|
# vim:ts=4:sw=4:expandtab
|
|
|
|
|
2010-04-17 16:49:26 -04:00
|
|
|
use i3test tests => 2;
|
2009-08-21 06:32:54 -04:00
|
|
|
use X11::XCB qw(:all);
|
|
|
|
use Time::HiRes qw(sleep);
|
2009-08-21 09:01:20 -04:00
|
|
|
use List::Util qw(first);
|
2009-08-21 06:32:54 -04:00
|
|
|
|
|
|
|
BEGIN {
|
|
|
|
use_ok('X11::XCB::Connection') or BAIL_OUT('Cannot load X11::XCB::Connection');
|
|
|
|
}
|
|
|
|
|
2010-11-28 16:12:53 -05:00
|
|
|
SKIP: {
|
|
|
|
skip "Dock clients not yet implemented", 1;
|
|
|
|
|
2009-10-26 15:04:37 -04:00
|
|
|
my $x = X11::XCB::Connection->new;
|
2009-08-21 06:32:54 -04:00
|
|
|
|
|
|
|
#####################################################################
|
|
|
|
# Create a dock window and see if it gets managed
|
|
|
|
#####################################################################
|
|
|
|
|
2009-10-26 15:04:37 -04:00
|
|
|
my $screens = $x->screens;
|
2009-08-21 09:01:20 -04:00
|
|
|
|
|
|
|
# Get the primary screen
|
|
|
|
my $primary = first { $_->primary } @{$screens};
|
|
|
|
|
|
|
|
# TODO: focus the primary screen before
|
|
|
|
|
2009-10-26 15:04:37 -04:00
|
|
|
my $window = $x->root->create_child(
|
2009-08-21 06:32:54 -04:00
|
|
|
class => WINDOW_CLASS_INPUT_OUTPUT,
|
|
|
|
rect => [ 0, 0, 30, 30],
|
2009-08-21 10:06:12 -04:00
|
|
|
background_color => '#FF0000',
|
2009-10-26 15:04:37 -04:00
|
|
|
type => $x->atom(name => '_NET_WM_WINDOW_TYPE_DOCK'),
|
2009-08-21 06:32:54 -04:00
|
|
|
);
|
|
|
|
|
|
|
|
$window->map;
|
|
|
|
|
|
|
|
sleep 0.25;
|
|
|
|
|
2009-08-21 09:01:20 -04:00
|
|
|
my $rect = $window->rect;
|
|
|
|
is($rect->width, $primary->rect->width, 'dock client is as wide as the screen');
|
2009-08-21 06:32:54 -04:00
|
|
|
|
2010-01-01 10:19:55 -05:00
|
|
|
my $fwindow = $x->root->create_child(
|
|
|
|
class => WINDOW_CLASS_INPUT_OUTPUT,
|
|
|
|
rect => [ 0, 0, 30, 30],
|
|
|
|
background_color => '#FF0000',
|
|
|
|
type => $x->atom(name => '_NET_WM_WINDOW_TYPE_DOCK'),
|
|
|
|
);
|
|
|
|
|
|
|
|
$fwindow->transient_for($window);
|
|
|
|
$fwindow->map;
|
|
|
|
|
|
|
|
sleep 0.25;
|
|
|
|
|
|
|
|
|
2009-08-21 09:01:20 -04:00
|
|
|
diag( "Testing i3, Perl $], $^X" );
|
2010-11-28 16:12:53 -05:00
|
|
|
}
|