2011-02-21 12:21:02 +01:00
|
|
|
#!perl
|
|
|
|
# vim:ts=4:sw=4:expandtab
|
|
|
|
#
|
|
|
|
# Regression test for inplace restarting with dock clients
|
|
|
|
#
|
|
|
|
use i3test;
|
|
|
|
|
2011-03-09 20:25:17 +01:00
|
|
|
my $tmp = fresh_workspace;
|
2011-02-21 12:21:02 +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
|
|
|
|
|
2011-11-22 00:47:32 +01:00
|
|
|
my $window = open_window({
|
2011-09-24 16:11:37 +02:00
|
|
|
background_color => '#FF0000',
|
|
|
|
window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_DOCK'),
|
|
|
|
});
|
2011-02-21 12:21:02 +01:00
|
|
|
|
|
|
|
#####################################################################
|
|
|
|
# check that we can find it in the layout tree at the expected position
|
|
|
|
#####################################################################
|
|
|
|
|
|
|
|
@docked = get_dock_clients;
|
|
|
|
is(@docked, 1, 'one dock client found');
|
|
|
|
|
|
|
|
# verify the height
|
|
|
|
my $docknode = $docked[0];
|
|
|
|
|
|
|
|
is($docknode->{rect}->{height}, 30, 'dock node has unchanged height');
|
|
|
|
|
|
|
|
# perform an inplace-restart
|
|
|
|
cmd 'restart';
|
|
|
|
|
|
|
|
does_i3_live;
|
|
|
|
|
|
|
|
|
|
|
|
#####################################################################
|
|
|
|
# check that we can still find the dock client
|
|
|
|
#####################################################################
|
|
|
|
|
|
|
|
@docked = get_dock_clients;
|
|
|
|
is(@docked, 1, 'one dock client found');
|
|
|
|
$docknode = $docked[0];
|
|
|
|
|
|
|
|
is($docknode->{rect}->{height}, 30, 'dock node has unchanged height after restart');
|
|
|
|
|
|
|
|
$window->destroy;
|
|
|
|
|
2011-11-21 23:44:20 +01:00
|
|
|
wait_for_unmap $window;
|
2011-02-21 12:21:02 +01:00
|
|
|
|
|
|
|
@docked = get_dock_clients;
|
|
|
|
is(@docked, 0, 'no dock clients found');
|
|
|
|
|
|
|
|
#####################################################################
|
|
|
|
# create a dock client with a 1px border
|
|
|
|
#####################################################################
|
|
|
|
|
2011-11-22 00:47:32 +01:00
|
|
|
$window = open_window({
|
2011-09-24 16:11:37 +02:00
|
|
|
border => 1,
|
|
|
|
rect => [ 0, 0, 30, 20 ],
|
|
|
|
background_color => '#00FF00',
|
|
|
|
window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_DOCK'),
|
|
|
|
});
|
2011-02-21 12:21:02 +01:00
|
|
|
|
|
|
|
@docked = get_dock_clients;
|
|
|
|
is(@docked, 1, 'one dock client found');
|
|
|
|
$docknode = $docked[0];
|
|
|
|
|
|
|
|
is($docknode->{rect}->{height}, 20, 'dock node has unchanged height');
|
|
|
|
|
|
|
|
cmd 'restart';
|
|
|
|
|
|
|
|
@docked = get_dock_clients;
|
|
|
|
is(@docked, 1, 'one dock client found');
|
|
|
|
$docknode = $docked[0];
|
|
|
|
|
|
|
|
is($docknode->{rect}->{height}, 20, 'dock node has unchanged height');
|
|
|
|
|
|
|
|
|
|
|
|
done_testing;
|