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 # Test the 'no_focus' directive.
19 use i3test i3_autostart => 0;
21 #####################################################################
22 # 1: open a window and check that it takes focus
23 #####################################################################
27 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
30 my $pid = launch_with_config($config);
32 my $ws = fresh_workspace;
33 my $first = open_window;
34 my $focused = get_focused($ws);
35 my $second = open_window;
37 isnt(get_focused($ws), $focused, 'focus has changed');
39 exit_gracefully($pid);
41 #####################################################################
42 # 2: open a window matched by a no_focus directive and check that
43 # it doesn't take focus
44 #####################################################################
48 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
50 no_focus [instance=notme]
53 my $pid = launch_with_config($config);
55 my $ws = fresh_workspace;
56 my $first = open_window;
57 my $focused = get_focused($ws);
58 my $second = open_window(wm_class => 'notme');
60 is(get_focused($ws), $focused, 'focus has not changed');
62 exit_gracefully($pid);
64 #####################################################################