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 # Regression: Checks if focus is stolen when a window is managed which is
18 # assigned to an invisible workspace
20 use i3test i3_autostart => 0;
24 $args{name} //= 'special window';
26 # We use dont_map because i3 will not map the window on the current
27 # workspace. Thus, open_window would time out in wait_for_map (2 seconds).
28 my $window = open_window(
30 wm_class => 'special',
37 #####################################################################
38 # start a window and see that it does not get assigned with an empty config
39 #####################################################################
43 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
44 assign [class="special"] targetws
47 my $pid = launch_with_config($config);
49 my $tmp = fresh_workspace;
51 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
52 ok(get_ws($tmp)->{focused}, 'current workspace focused');
54 my $window = open_special;
57 ok(@{get_ws_content($tmp)} == 0, 'special window not on current workspace');
58 ok(@{get_ws_content('targetws')} == 1, 'special window on targetws');
59 ok(get_ws($tmp)->{focused}, 'current workspace still focused');
61 #####################################################################
62 # the same test, but with a floating window
63 #####################################################################
65 $window = open_special(
66 window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_UTILITY'),
69 ok(@{get_ws_content($tmp)} == 0, 'special window not on current workspace');
70 ok(@{get_ws_content('targetws')} == 1, 'special window on targetws');
71 ok(get_ws($tmp)->{focused}, 'current workspace still focused');
73 exit_gracefully($pid);