]> git.sur5r.net Git - i3/i3/blob - testcases/t/104-focus-stack.t
Merge pull request #3388 from orestisf1993/cmd_rename_workspace
[i3/i3] / testcases / t / 104-focus-stack.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 # Checks if the focus is correctly restored, when creating a floating client
18 # over an unfocused tiling client and destroying the floating one again.
19
20 use i3test;
21
22 fresh_workspace;
23
24 cmd 'split h';
25 my $tiled_left = open_window;
26 my $tiled_right = open_window;
27
28 # Get input focus before creating the floating window
29 my $focus = $x->input_focus;
30
31 # Create a floating window which is smaller than the minimum enforced size of i3
32 my $window = open_floating_window;
33
34 is($x->input_focus, $window->id, 'floating window focused');
35
36 $window->unmap;
37
38 wait_for_unmap $window;
39
40 is($x->input_focus, $focus, 'Focus correctly restored');
41
42 done_testing;