]> git.sur5r.net Git - i3/i3/blob - testcases/t/127-regress-floating-parent.t
Update ewmh focused only when new focus is different (#3496)
[i3/i3] / testcases / t / 127-regress-floating-parent.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 # Regression: make a container floating, kill its parent, make it tiling again
18 #
19 use i3test;
20
21 my $tmp = fresh_workspace;
22
23 cmd 'open';
24 my $left = get_focused($tmp);
25 cmd 'open';
26 my $old = get_focused($tmp);
27 cmd 'split v';
28 cmd 'open';
29 my $floating = get_focused($tmp);
30 diag("focused floating: " . get_focused($tmp));
31 cmd 'mode toggle';
32 sync_with_i3;
33
34 # kill old container
35 cmd qq|[con_id="$old"] focus|;
36 is(get_focused($tmp), $old, 'old container focused');
37 cmd 'kill';
38
39 # kill left container
40 cmd qq|[con_id="$left"] focus|;
41 is(get_focused($tmp), $left, 'old container focused');
42 cmd 'kill';
43
44 # focus floating window, make it tiling again
45 cmd qq|[con_id="$floating"] focus|;
46 is(get_focused($tmp), $floating, 'floating window focused');
47
48 sync_with_i3;
49 cmd 'mode toggle';
50
51 does_i3_live;
52
53 done_testing;