]> git.sur5r.net Git - i3/i3/blob - testcases/t/13-urgent.t
cf847456f82a36582ce98856d622720a012a0a26
[i3/i3] / testcases / t / 13-urgent.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 # Beware that this test uses workspace 9 to perform some tests (it expects
4 # the workspace to be empty).
5 # TODO: skip it by default?
6
7 use i3test tests => 7;
8 use X11::XCB qw(:all);
9 use Time::HiRes qw(sleep);
10
11 BEGIN {
12     use_ok('X11::XCB::Connection') or BAIL_OUT('Cannot load X11::XCB::Connection');
13 }
14
15 my $x = X11::XCB::Connection->new;
16
17 my $i3 = i3;
18
19 # Switch to the nineth workspace
20 $i3->command('9')->recv;
21
22 #####################################################################
23 # Create two windows and put them in stacking mode
24 #####################################################################
25
26 my $top = i3test::open_standard_window($x);
27 sleep 0.25;
28 my $bottom = i3test::open_standard_window($x);
29 sleep 0.25;
30
31 $i3->command('s')->recv;
32
33 #####################################################################
34 # Add the urgency hint, switch to a different workspace and back again
35 #####################################################################
36 $top->add_hint('urgency');
37 sleep 1;
38
39 $i3->command('1')->recv;
40 $i3->command('9')->recv;
41 $i3->command('1')->recv;
42
43 my $std = i3test::open_standard_window($x);
44 sleep 0.25;
45 $std->add_hint('urgency');
46 sleep 1;