2011-03-04 15:21:18 +01:00
|
|
|
#!perl
|
|
|
|
# vim:ts=4:sw=4:expandtab
|
|
|
|
#
|
|
|
|
# Regression test for closing one of multiple dock clients
|
|
|
|
#
|
|
|
|
use X11::XCB qw(:all);
|
|
|
|
use i3test;
|
|
|
|
|
|
|
|
BEGIN {
|
|
|
|
use_ok('X11::XCB::Window');
|
|
|
|
}
|
|
|
|
|
|
|
|
my $x = X11::XCB::Connection->new;
|
|
|
|
|
2011-03-09 20:25:17 +01:00
|
|
|
my $tmp = fresh_workspace;
|
2011-03-04 15:21:18 +01:00
|
|
|
|
|
|
|
#####################################################################
|
|
|
|
# verify that there is no dock window yet
|
|
|
|
#####################################################################
|
|
|
|
|
|
|
|
# Children of all dockareas
|
|
|
|
my @docked = get_dock_clients;
|
|
|
|
|
|
|
|
is(@docked, 0, 'no dock clients yet');
|
|
|
|
|
|
|
|
#####################################################################
|
|
|
|
# open a dock client
|
|
|
|
#####################################################################
|
|
|
|
|
|
|
|
my $first = $x->root->create_child(
|
|
|
|
class => WINDOW_CLASS_INPUT_OUTPUT,
|
|
|
|
rect => [ 0, 0, 30, 30],
|
|
|
|
background_color => '#FF0000',
|
|
|
|
window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_DOCK'),
|
2011-09-24 14:08:02 +02:00
|
|
|
event_mask => [ 'structure_notify' ],
|
2011-03-04 15:21:18 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
$first->map;
|
|
|
|
|
2011-09-24 14:08:02 +02:00
|
|
|
wait_for_map $x;
|
2011-03-04 15:21:18 +01:00
|
|
|
|
|
|
|
#####################################################################
|
|
|
|
# Open a second dock client
|
|
|
|
#####################################################################
|
|
|
|
|
|
|
|
my $second = $x->root->create_child(
|
|
|
|
class => WINDOW_CLASS_INPUT_OUTPUT,
|
|
|
|
rect => [ 0, 0, 30, 30],
|
|
|
|
background_color => '#FF0000',
|
|
|
|
window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_DOCK'),
|
2011-09-24 14:08:02 +02:00
|
|
|
event_mask => [ 'structure_notify' ],
|
2011-03-04 15:21:18 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
$second->map;
|
|
|
|
|
2011-09-24 14:08:02 +02:00
|
|
|
wait_for_map $x;
|
2011-03-04 15:21:18 +01:00
|
|
|
|
|
|
|
#####################################################################
|
|
|
|
# Kill the second dock client
|
|
|
|
#####################################################################
|
|
|
|
cmd "nop destroying dock client";
|
|
|
|
$second->destroy;
|
|
|
|
|
|
|
|
#####################################################################
|
|
|
|
# Now issue a focus command
|
|
|
|
#####################################################################
|
|
|
|
cmd 'next v';
|
|
|
|
|
|
|
|
does_i3_live;
|
|
|
|
|
|
|
|
done_testing;
|