]> git.sur5r.net Git - i3/i3/blob - testcases/t/136-floating-ws-empty.t
Merge pull request #3475 from Gravemind/fix-i3bar-re-hidden-on-any-modifier
[i3/i3] / testcases / t / 136-floating-ws-empty.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 test: when only having a floating window on a workspace, it should
18 # not be deleted.
19
20 use i3test;
21
22 my $i3 = i3(get_socket_path());
23
24 my $tmp = fresh_workspace;
25
26 #############################################################################
27 # 1: open a floating window, get it mapped
28 #############################################################################
29
30 ok(workspace_exists($tmp), "workspace $tmp exists");
31
32 # Create a floating window which is smaller than the minimum enforced size of i3
33 my $window = open_floating_window;
34 ok($window->mapped, 'Window is mapped');
35
36 # switch to a different workspace, see if the window is still mapped?
37
38 my $otmp = fresh_workspace;
39
40 ok(workspace_exists($otmp), "new workspace $otmp exists");
41 ok(workspace_exists($tmp), "old workspace $tmp still exists");
42
43 ################################################################################
44 # 2: Similar test: Have two floating windows on a workspace, close one of them.
45 # The workspace should not be closed. Regression present until (including) commit
46 # 1f2c9306a27cced83ad960e929bb9e9a163b7843
47 ################################################################################
48
49 $tmp = fresh_workspace;
50
51 ok(workspace_exists($tmp), "workspace $tmp exists");
52
53 # Create a floating window which is smaller than the minimum enforced size of i3
54 my $first = open_floating_window;
55 my $second = open_floating_window;
56 ok($first->mapped, 'Window is mapped');
57 ok($second->mapped, 'Window is mapped');
58
59 $otmp = fresh_workspace;
60
61 ok(workspace_exists($otmp), "new workspace $otmp exists");
62 ok(workspace_exists($tmp), "old workspace $tmp still exists");
63
64 $first->unmap;
65 wait_for_unmap $first;
66
67 ok(workspace_exists($otmp), "new workspace $otmp exists");
68 ok(workspace_exists($tmp), "old workspace $tmp still exists");
69
70 done_testing;