2 # vim:ts=4:sw=4:expandtab
3 # !NO_I3_INSTANCE! will prevent complete-run.pl from starting i3
5 # Tests if the 'force_focus_wrapping' config directive works correctly.
9 #####################################################################
10 # 1: test the wrapping behaviour without force_focus_wrapping
11 #####################################################################
15 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
18 my $pid = launch_with_config($config);
20 my $tmp = fresh_workspace;
22 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
24 my $first = open_window($x);
25 my $second = open_window($x);
30 my $third = open_window($x);
31 is($x->input_focus, $third->id, 'third window focused');
34 is($x->input_focus, $second->id, 'second window focused');
37 is($x->input_focus, $first->id, 'first window focused');
39 # now test the wrapping
41 is($x->input_focus, $second->id, 'second window focused');
43 # but focusing right should not wrap now, but instead focus the third window
45 is($x->input_focus, $third->id, 'third window focused');
47 exit_gracefully($pid);
49 #####################################################################
50 # 2: test the wrapping behaviour with force_focus_wrapping
51 #####################################################################
55 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
56 force_focus_wrapping true
59 $pid = launch_with_config($config);
61 $tmp = fresh_workspace;
63 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
65 $first = open_window($x);
66 $second = open_window($x);
71 $third = open_window($x);
75 is($x->input_focus, $third->id, 'third window focused');
78 is($x->input_focus, $second->id, 'second window focused');
81 is($x->input_focus, $first->id, 'first window focused');
83 # now test the wrapping
85 is($x->input_focus, $second->id, 'second window focused');
87 # focusing right should now be forced to wrap
89 is($x->input_focus, $first->id, 'first window focused');
91 exit_gracefully($pid);