]> git.sur5r.net Git - i3/i3/blob - testcases/t/519-mouse-warping.t
tests: use i3_config arg instead of precisely one launch_with_config
[i3/i3] / testcases / t / 519-mouse-warping.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 #
4 # Please read the following documents before working on tests:
5 # • http://build.i3wm.org/docs/testsuite.html
6 #   (or docs/testsuite)
7 #
8 # • http://build.i3wm.org/docs/lib-i3test.html
9 #   (alternatively: perldoc ./testcases/lib/i3test.pm)
10 #
11 # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
12 #   (unless you are already familiar with Perl)
13
14 use i3test i3_config => <<EOT;
15 # i3 config file (v4)
16 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
17 fake-outputs 1024x768+0+0,1024x768+1024+0
18 mouse_warping none
19 EOT
20
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);
24
25 ######################################################
26 # Open one workspace with one window on both outputs #
27 ######################################################
28
29 # Open window on workspace 1, left output
30 is(focused_ws, '1', 'starting with focus on workspace 1');
31 open_window;
32
33 # Open window on workspace 2, right output
34 cmd 'focus output right';
35 is(focused_ws, '2', 'moved focus to workspace 2');
36 open_window;
37
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);
41
42 # Ensure focus is still on workspace 2
43 is(focused_ws, '2', 'warped mouse cursor to (0, 0), focus still in workspace 2');
44
45 done_testing;