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 use X11::XCB::Connection;
11 my $x = X11::XCB::Connection->new;
13 #####################################################################
14 # 1: test the wrapping behaviour without force_focus_wrapping
15 #####################################################################
19 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
22 my $process = launch_with_config($config);
24 my $tmp = fresh_workspace;
26 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
28 my $first = open_window($x);
29 my $second = open_window($x);
34 my $third = open_window($x);
35 is($x->input_focus, $third->id, 'third window focused');
38 is($x->input_focus, $second->id, 'second window focused');
41 is($x->input_focus, $first->id, 'first window focused');
43 # now test the wrapping
45 is($x->input_focus, $second->id, 'second window focused');
47 # but focusing right should not wrap now, but instead focus the third window
49 is($x->input_focus, $third->id, 'third window focused');
51 exit_gracefully($process->pid);
53 #####################################################################
54 # 2: test the wrapping behaviour with force_focus_wrapping
55 #####################################################################
59 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
60 force_focus_wrapping true
63 $process = launch_with_config($config);
65 $tmp = fresh_workspace;
67 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
69 $first = open_window($x);
70 $second = open_window($x);
75 $third = open_window($x);
79 is($x->input_focus, $third->id, 'third window focused');
82 is($x->input_focus, $second->id, 'second window focused');
85 is($x->input_focus, $first->id, 'first window focused');
87 # now test the wrapping
89 is($x->input_focus, $second->id, 'second window focused');
91 # focusing right should now be forced to wrap
93 is($x->input_focus, $first->id, 'first window focused');
95 exit_gracefully($process->pid);