]> git.sur5r.net Git - i3/i3/blob - testcases/t/131-stacking-order.t
Merge branch 'release-4.16.1'
[i3/i3] / testcases / t / 131-stacking-order.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 #
4 # Please read the following documents before working on tests:
5 # • https://build.i3wm.org/docs/testsuite.html
6 #   (or docs/testsuite)
7 #
8 # • https://build.i3wm.org/docs/lib-i3test.html
9 #   (alternatively: perldoc ./testcases/lib/i3test.pm)
10 #
11 # • https://build.i3wm.org/docs/ipc.html
12 #   (or docs/ipc)
13 #
14 # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
15 #   (unless you are already familiar with Perl)
16 #
17 # Check if stacking containers can be used independently of
18 # the split mode (horizontal/vertical) of the underlying
19 # container.
20 #
21 use i3test;
22
23 my $i3 = i3(get_socket_path());
24
25 my $tmp = fresh_workspace;
26
27 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
28
29 # Enforce vertical split mode
30 cmd 'split v';
31
32 my $first = open_empty_con($i3);
33 my $second = open_empty_con($i3);
34
35 isnt($first, $second, 'two different containers opened');
36
37 ##############################################################
38 # change mode to stacking and cycle through the containers
39 ##############################################################
40
41 cmd 'layout stacking';
42 is(get_focused($tmp), $second, 'second container still focused');
43
44 cmd 'focus down';
45 is(get_focused($tmp), $first, 'first container focused');
46
47 cmd 'focus up';
48 is(get_focused($tmp), $second, 'second container focused again');
49
50 ##############################################################
51 # now change the orientation to horizontal and cycle
52 ##############################################################
53
54 cmd 'focus parent';
55 cmd 'split h';
56 cmd 'focus child';
57
58 cmd 'focus down';
59 is(get_focused($tmp), $first, 'first container focused');
60
61 cmd 'focus up';
62 is(get_focused($tmp), $second, 'second container focused again');
63
64
65 done_testing;