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 if scrolling the tab bar on a tabbed container works and verifies that
18 # only one window is focused as a result.
20 # Bug still in: 4.15-92-g666aa9e0
25 # button5 = scroll down
26 xtest_button_press(5, 3, 3);
27 xtest_button_release(5, 3, 3);
33 xtest_button_press(4, 3, 3);
34 xtest_button_release(4, 3, 3);
38 # Decoration of top left window.
39 $x->root->warp_pointer(3, 3);
41 # H [ T [ H [ A B ] C D V [ E F ] ] G ]
42 # Inner horizontal split.
46 my $first = open_window;
50 my $second_last = open_window;
54 my $last = open_window;
55 # Second child of the outer horizontal split, next to the tabbed one.
56 my $outside = open_window;
57 cmd 'move right, move right';
59 cmd '[id=' . $first->id . '] focus';
61 # Scroll from first to last.
64 is($x->input_focus, $second_last->id, 'Sanity check: scrolling');
66 is($x->input_focus, $last->id, 'Last window focused through scrolling');
68 is($x->input_focus, $last->id, 'Scrolling again doesn\'t leave the tabbed container and doesn\'t focus the whole sibling');
70 # Scroll from last to first.
72 is($x->input_focus, $second_last->id, 'Scrolling up works');
75 is($x->input_focus, $first->id, 'First window focused through scrolling');
77 is($x->input_focus, $first->id, 'Scrolling again doesn\'t focus the whole sibling');
79 # Try scrolling with another window focused
80 cmd '[id=' . $outside->id . '] focus';
82 is($x->input_focus, $first->id, 'Scrolling from outside the tabbed container works');