]> git.sur5r.net Git - i3/i3/blob - testcases/t/236-floating-focus-raise.t
tests: replace http:// with https:// where appropriate
[i3/i3] / testcases / t / 236-floating-focus-raise.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 # Test that focusing floating windows with the command `focus [direction]`
18 # promotes the focused window to the top of the rendering stack.
19 # Ticket: #1322
20 # Bug still in: 4.8-88-gcc09348
21 use i3test;
22
23 my $ws = fresh_workspace;
24
25 my $win1 = open_floating_window;
26 my $win2 = open_floating_window;
27 my $win3 = open_floating_window;
28
29 # it's a good idea to do this a few times because of the implementation
30 for my $i (1 .. 3) {
31     cmd 'focus left';
32     my $ws_con = get_ws($ws);
33     is($ws_con->{floating_nodes}[-1]->{nodes}[0]->{id}, get_focused($ws),
34         "focus left put the focused window on top of the floating windows (try $i)");
35 }
36
37 for my $i (1 .. 3) {
38     cmd 'focus right';
39     my $ws_con = get_ws($ws);
40     is($ws_con->{floating_nodes}[-1]->{nodes}[0]->{id}, get_focused($ws),
41         "focus right put the focused window on top of the floating windows (try $i)");
42 }
43
44 done_testing;