2 # vim:ts=4:sw=4:expandtab
4 # Please read the following documents before working on tests:
5 # • https://build.i3wm.org/docs/testsuite.html
8 # • https://build.i3wm.org/docs/lib-i3test.html
9 # (alternatively: perldoc ./testcases/lib/i3test.pm)
11 # • https://build.i3wm.org/docs/ipc.html
14 # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
15 # (unless you are already familiar with Perl)
17 # Regression test: when only having a floating window on a workspace, it should
22 my $i3 = i3(get_socket_path());
24 my $tmp = fresh_workspace;
26 #############################################################################
27 # 1: open a floating window, get it mapped
28 #############################################################################
30 ok(workspace_exists($tmp), "workspace $tmp exists");
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');
36 # switch to a different workspace, see if the window is still mapped?
38 my $otmp = fresh_workspace;
40 ok(workspace_exists($otmp), "new workspace $otmp exists");
41 ok(workspace_exists($tmp), "old workspace $tmp still exists");
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 ################################################################################
49 $tmp = fresh_workspace;
51 ok(workspace_exists($tmp), "workspace $tmp exists");
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');
59 $otmp = fresh_workspace;
61 ok(workspace_exists($otmp), "new workspace $otmp exists");
62 ok(workspace_exists($tmp), "old workspace $tmp still exists");
65 wait_for_unmap $first;
67 ok(workspace_exists($otmp), "new workspace $otmp exists");
68 ok(workspace_exists($tmp), "old workspace $tmp still exists");