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 # • https://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 # Tests the focus_follows_mouse setting.
18 use i3test i3_config => <<EOT;
20 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
22 fake-outputs 1000x1000+0+0
27 sub synced_warp_pointer {
28 my ($x_px, $y_px) = @_;
30 $x->root->warp_pointer($x_px, $y_px);
34 ###################################################################
35 # Test a simple case with 2 windows.
36 ###################################################################
38 synced_warp_pointer(600, 600);
40 $second = open_window;
41 is($x->input_focus, $second->id, 'second window focused');
43 synced_warp_pointer(0, 0);
44 is($x->input_focus, $first->id, 'first window focused');
46 ###################################################################
47 # Test that focus isn't changed with tabbed windows.
48 ###################################################################
51 synced_warp_pointer(600, 600);
54 $second = open_window;
55 is($x->input_focus, $second->id, 'second (tabbed) window focused');
57 synced_warp_pointer(0, 0);
58 is($x->input_focus, $second->id, 'second window still focused');