2 # vim:ts=4:sw=4:expandtab
4 # Please read the following documents before working on tests:
5 # • http://build.i3wm.org/docs/testsuite.html
8 # • http://build.i3wm.org/docs/lib-i3test.html
9 # (alternatively: perldoc ./testcases/lib/i3test.pm)
11 # • http://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 # Ensures that mouse bindings on the i3bar work correctly.
19 use i3test i3_autostart => 0;
25 $timer = AE::timer(1, 0, sub { $cv->send(0); });
30 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
31 focus_follows_mouse no
34 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
37 bindsym button1 focus left
38 bindsym button2 focus right
39 bindsym button3 focus left
40 bindsym button4 focus right
41 bindsym button5 focus left
45 my $pid = launch_with_config($config);
46 my $i3 = i3(get_socket_path());
48 my $ws = fresh_workspace;
54 if ($event->{change} eq 'focus') {
55 $cv->send($event->{container});
60 my $left = open_window;
61 my $right = open_window;
64 is($con->{window}, $right->{id}, 'focus is initially on the right container');
67 xtest_button_press(1, 3, 3);
68 xtest_button_release(1, 3, 3);
71 is($con->{window}, $left->{id}, 'button 1 moves focus left');
74 xtest_button_press(2, 3, 3);
75 xtest_button_release(2, 3, 3);
78 is($con->{window}, $right->{id}, 'button 2 moves focus right');
81 xtest_button_press(3, 3, 3);
82 xtest_button_release(3, 3, 3);
85 is($con->{window}, $left->{id}, 'button 3 moves focus left');
88 xtest_button_press(4, 3, 3);
89 xtest_button_release(4, 3, 3);
92 is($con->{window}, $right->{id}, 'button 4 moves focus right');
95 xtest_button_press(5, 3, 3);
96 xtest_button_release(5, 3, 3);
99 is($con->{window}, $left->{id}, 'button 5 moves focus left');
102 exit_gracefully($pid);