]> git.sur5r.net Git - i3/i3/blob - testcases/t/54-regress-multiple-dock.t
tests: get the socket path from the X11 atom I3_SOCKET_PATH
[i3/i3] / testcases / t / 54-regress-multiple-dock.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 #
4 # Regression test for closing one of multiple dock clients
5 #
6 use X11::XCB qw(:all);
7 use i3test;
8
9 BEGIN {
10     use_ok('X11::XCB::Window');
11 }
12
13 my $x = X11::XCB::Connection->new;
14 my $i3 = i3(get_socket_path());
15
16 my $tmp = fresh_workspace;
17
18 #####################################################################
19 # verify that there is no dock window yet
20 #####################################################################
21
22 # Children of all dockareas
23 my @docked = get_dock_clients;
24
25 is(@docked, 0, 'no dock clients yet');
26
27 #####################################################################
28 # open a dock client
29 #####################################################################
30
31 my $first = $x->root->create_child(
32     class => WINDOW_CLASS_INPUT_OUTPUT,
33     rect => [ 0, 0, 30, 30],
34     background_color => '#FF0000',
35     window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_DOCK'),
36 );
37
38 $first->map;
39
40 sleep 0.25;
41
42 #####################################################################
43 # Open a second dock client
44 #####################################################################
45
46 my $second = $x->root->create_child(
47     class => WINDOW_CLASS_INPUT_OUTPUT,
48     rect => [ 0, 0, 30, 30],
49     background_color => '#FF0000',
50     window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_DOCK'),
51 );
52
53 $second->map;
54
55 sleep 0.25;
56
57 #####################################################################
58 # Kill the second dock client
59 #####################################################################
60 cmd "nop destroying dock client";
61 $second->destroy;
62
63 #####################################################################
64 # Now issue a focus command
65 #####################################################################
66 cmd 'next v';
67
68 does_i3_live;
69
70 done_testing;