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 # Assure that no window is in fullscreen mode after showing a scratchpad window
18 # Bug still in: 4.5.1-54-g0f6b5fe
22 my $tmp = fresh_workspace;
24 sub fullscreen_windows {
28 my $nodes = scalar grep { $_->{fullscreen_mode} != 0 } @{get_ws_content($ws)->[0]->{nodes}};
29 my $cons = scalar grep { $_->{fullscreen_mode} != 0 } @{get_ws_content($ws)};
30 return $nodes + $cons;
33 ##########################################################################################
34 # map two windows in one container, fullscreen one of them and then move it to scratchpad
35 ##########################################################################################
37 my $first_win = open_window;
38 my $second_win = open_window;
40 # fullscreen the focused window
43 # see if the window really is in fullscreen mode
44 is(fullscreen_windows(), 1, 'amount of fullscreen windows after enabling fullscreen');
46 # move window to scratchpad
47 cmd 'move scratchpad';
49 ###############################################################################
50 # show the scratchpad window again; it should not be in fullscreen mode anymore
51 ###############################################################################
53 # show window from scratchpad
54 cmd 'scratchpad show';
56 # switch window back to tiling mode
57 cmd 'floating toggle';
59 # see if no window is in fullscreen mode
60 is(fullscreen_windows(), 0, 'amount of fullscreen windows after showing previously fullscreened scratchpad window');
62 ########################################################################################
63 # move a window to scratchpad, focus parent container, make it fullscreen, focus a child
64 ########################################################################################
69 # move one window to scratchpad
70 cmd 'move scratchpad';
75 # fullscreen the container
81 # see if the window really is in fullscreen mode
82 is(fullscreen_windows(), 1, 'amount of fullscreen windows after enabling fullscreen on parent');
84 ##########################################################################
85 # show a scratchpad window; no window should be in fullscreen mode anymore
86 ##########################################################################
88 # show the scratchpad window
89 cmd 'scratchpad show';
91 # see if no window is in fullscreen mode
92 is(fullscreen_windows(), 0, 'amount of fullscreen windows after showing a scratchpad window while a parent container was in fullscreen mode');