]> git.sur5r.net Git - i3/i3/blob - testcases/t/162-regress-dock-urgent.t
testcases: let i3test.pm export $x, adapt testcases
[i3/i3] / testcases / t / 162-regress-dock-urgent.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 #
4 # Regression test for setting the urgent hint on dock clients.
5 # found in 4be3178d4d360c2996217d811e61161c84d25898
6 #
7 use i3test;
8 use X11::XCB 'WINDOW_CLASS_INPUT_OUTPUT';
9
10 my $i3 = i3(get_socket_path());
11
12 my $tmp = fresh_workspace;
13
14 #####################################################################
15 # verify that there is no dock window yet
16 #####################################################################
17
18 # Children of all dockareas
19 my @docked = get_dock_clients;
20
21 is(@docked, 0, 'no dock clients yet');
22
23 # open a dock client
24
25 my $window = $x->root->create_child(
26     class => WINDOW_CLASS_INPUT_OUTPUT,
27     rect => [ 0, 0, 30, 30],
28     background_color => '#FF0000',
29     window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_DOCK'),
30 );
31
32 $window->map;
33
34 sleep 0.25;
35
36 #####################################################################
37 # check that we can find it in the layout tree at the expected position
38 #####################################################################
39
40 @docked = get_dock_clients;
41 is(@docked, 1, 'one dock client found');
42
43 # verify the height
44 my $docknode = $docked[0];
45
46 is($docknode->{rect}->{height}, 30, 'dock node has unchanged height');
47
48 $window->add_hint('urgency');
49
50 sync_with_i3($x);
51
52 does_i3_live;
53
54 done_testing;