]> git.sur5r.net Git - i3/i3/blob - testcases/t/136-floating-ws-empty.t
Merge branch 'master' into next
[i3/i3] / testcases / t / 136-floating-ws-empty.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 # Regression test: when only having a floating window on a workspace, it should not be deleted.
4
5 use i3test;
6
7 my $i3 = i3(get_socket_path());
8
9 my $tmp = fresh_workspace;
10
11 #############################################################################
12 # 1: open a floating window, get it mapped
13 #############################################################################
14
15 ok(workspace_exists($tmp), "workspace $tmp exists");
16
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');
20
21 # switch to a different workspace, see if the window is still mapped?
22
23 my $otmp = fresh_workspace;
24
25 ok(workspace_exists($otmp), "new workspace $otmp exists");
26 ok(workspace_exists($tmp), "old workspace $tmp still exists");
27
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 ################################################################################
33
34 $tmp = fresh_workspace;
35
36 ok(workspace_exists($tmp), "workspace $tmp exists");
37
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');
43
44 $otmp = fresh_workspace;
45
46 ok(workspace_exists($otmp), "new workspace $otmp exists");
47 ok(workspace_exists($tmp), "old workspace $tmp still exists");
48
49 $first->unmap;
50 wait_for_unmap $first;
51
52 ok(workspace_exists($otmp), "new workspace $otmp exists");
53 ok(workspace_exists($tmp), "old workspace $tmp still exists");
54
55 done_testing;