2 # vim:ts=4:sw=4:expandtab
4 # Please read the following documents before working on tests:
5 # • http://build.i3wm.org/docs/testsuite.html
8 # • http://build.i3wm.org/docs/lib-i3test.html
9 # (alternatively: perldoc ./testcases/lib/i3test.pm)
11 # • http://build.i3wm.org/docs/ipc.html
14 # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
15 # (unless you are already familiar with Perl)
17 # Tests if the urgency hint will be set appropriately when opening a window
18 # assigned to a workspace.
20 use i3test i3_autostart => 0;
22 # Based on the eponymous function in t/166-assign.t
25 $args{name} //= 'special window';
27 # We use dont_map because i3 will not map the window on the current
28 # workspace. Thus, open_window would time out in wait_for_map (2 seconds).
29 my $window = open_window(
31 wm_class => 'special',
38 #####################################################################
39 # start a window assigned to a non-visible workspace and see that the urgency
41 #####################################################################
45 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
46 assign [class="special"] → targetws
49 my $pid = launch_with_config($config);
51 cmd 'workspace ordinaryws';
52 my $window = open_special;
55 ok(get_ws('targetws')->{urgent}, 'target workspace is urgent');
59 exit_gracefully($pid);
62 #####################################################################
63 # start a window assigned to a visible workspace and see that the urgency hint
65 #####################################################################
69 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
70 assign [class="special"] → targetws
73 $pid = launch_with_config($config);
75 cmd 'workspace targetws';
76 $window = open_special;
79 ok(!get_ws('targetws')->{urgent}, 'visible workspace is not urgent');
83 exit_gracefully($pid);
85 #####################################################################
86 # start a window assigned to a visible workspace on a different output and see
87 # that the urgency hint is not set.
88 #####################################################################
92 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
94 fake-outputs 1024x768+0+0,1024x768+1024+0
95 workspace targetws output fake-0
96 workspace ordinaryws output fake-1
98 assign [class="special"] → targetws
101 $pid = launch_with_config($config);
103 cmd 'workspace ordinaryws';
104 $window = open_special;
107 ok(!get_ws('targetws')->{urgent}, 'target workspace is not urgent');
111 exit_gracefully($pid);