aboutsummaryrefslogtreecommitdiff
path: root/testcases/t/104-focus-stack.t
blob: d219336857dea62aa5b8cffc147e5ec3d5b7e437 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!perl
# vim:ts=4:sw=4:expandtab
#
# Please read the following documents before working on tests:
# • https://build.i3wm.org/docs/testsuite.html
#   (or docs/testsuite)
#
# • https://build.i3wm.org/docs/lib-i3test.html
#   (alternatively: perldoc ./testcases/lib/i3test.pm)
#
# • https://build.i3wm.org/docs/ipc.html
#   (or docs/ipc)
#
# • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
#   (unless you are already familiar with Perl)
#
# Checks if the focus is correctly restored, when creating a floating client
# over an unfocused tiling client and destroying the floating one again.

use i3test;

fresh_workspace;

cmd 'split h';
my $tiled_left = open_window;
my $tiled_right = open_window;

# Get input focus before creating the floating window
my $focus = $x->input_focus;

# Create a floating window which is smaller than the minimum enforced size of i3
my $window = open_floating_window;

is($x->input_focus, $window->id, 'floating window focused');

$window->unmap;

wait_for_unmap $window;

is($x->input_focus, $focus, 'Focus correctly restored');

done_testing;