2 # vim:ts=4:sw=4:expandtab
4 # Please read the following documents before working on tests:
5 # • https://build.i3wm.org/docs/testsuite.html
8 # • https://build.i3wm.org/docs/lib-i3test.html
9 # (alternatively: perldoc ./testcases/lib/i3test.pm)
11 # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
12 # (unless you are already familiar with Perl)
14 use i3test i3_config => <<EOT;
16 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
17 fake-outputs 1024x768+0+0,1024x768+1024+0
21 # Ensure the pointer is at (0, 0) so that we really start on the first
22 # (the left) workspace.
23 $x->root->warp_pointer(0, 0);
25 ######################################################
26 # Open one workspace with one window on both outputs #
27 ######################################################
29 # Open window on workspace 1, left output
30 is(focused_ws, '1', 'starting with focus on workspace 1');
33 # Open window on workspace 2, right output
34 cmd 'focus output right';
35 is(focused_ws, '2', 'moved focus to workspace 2');
38 # If mouse_warping is disabled, the pointer has not moved from
39 # position (0, 0) when focus was switched to workspace 2
40 $x->root->warp_pointer(0, 0);
42 # Ensure focus is still on workspace 2
43 is(focused_ws, '2', 'warped mouse cursor to (0, 0), focus still in workspace 2');