]> git.sur5r.net Git - i3/i3/blob - testcases/t/162-regress-dock-urgent.t
Merge branch 'fix-take-focus'
[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 X11::XCB qw(:all);
8 use i3test;
9
10 BEGIN {
11     use_ok('X11::XCB::Window');
12 }
13
14 my $x = X11::XCB::Connection->new;
15 my $i3 = i3(get_socket_path());
16
17 my $tmp = fresh_workspace;
18
19 #####################################################################
20 # verify that there is no dock window yet
21 #####################################################################
22
23 # Children of all dockareas
24 my @docked = get_dock_clients;
25
26 is(@docked, 0, 'no dock clients yet');
27
28 # open a dock client
29
30 my $window = $x->root->create_child(
31     class => WINDOW_CLASS_INPUT_OUTPUT,
32     rect => [ 0, 0, 30, 30],
33     background_color => '#FF0000',
34     window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_DOCK'),
35 );
36
37 $window->map;
38
39 sleep 0.25;
40
41 #####################################################################
42 # check that we can find it in the layout tree at the expected position
43 #####################################################################
44
45 @docked = get_dock_clients;
46 is(@docked, 1, 'one dock client found');
47
48 # verify the height
49 my $docknode = $docked[0];
50
51 is($docknode->{rect}->{height}, 30, 'dock node has unchanged height');
52
53 $window->add_hint('urgency');
54
55 sync_with_i3($x);
56
57 does_i3_live;
58
59 done_testing;