2 # vim:ts=4:sw=4:expandtab
3 # Regression test: when only having a floating window on a workspace, it should not be deleted.
7 my $i3 = i3(get_socket_path());
9 my $tmp = fresh_workspace;
11 #############################################################################
12 # 1: open a floating window, get it mapped
13 #############################################################################
15 ok(workspace_exists($tmp), "workspace $tmp exists");
17 # Create a floating window which is smaller than the minimum enforced size of i3
18 my $window = open_floating_window;
19 ok($window->mapped, 'Window is mapped');
21 # switch to a different workspace, see if the window is still mapped?
23 my $otmp = fresh_workspace;
25 ok(workspace_exists($otmp), "new workspace $otmp exists");
26 ok(workspace_exists($tmp), "old workspace $tmp still exists");
28 ################################################################################
29 # 2: Similar test: Have two floating windows on a workspace, close one of them.
30 # The workspace should not be closed. Regression present until (including) commit
31 # 1f2c9306a27cced83ad960e929bb9e9a163b7843
32 ################################################################################
34 $tmp = fresh_workspace;
36 ok(workspace_exists($tmp), "workspace $tmp exists");
38 # Create a floating window which is smaller than the minimum enforced size of i3
39 my $first = open_floating_window;
40 my $second = open_floating_window;
41 ok($first->mapped, 'Window is mapped');
42 ok($second->mapped, 'Window is mapped');
44 $otmp = fresh_workspace;
46 ok(workspace_exists($otmp), "new workspace $otmp exists");
47 ok(workspace_exists($tmp), "old workspace $tmp still exists");
50 wait_for_unmap $first;
52 ok(workspace_exists($otmp), "new workspace $otmp exists");
53 ok(workspace_exists($tmp), "old workspace $tmp still exists");