2 # vim:ts=4:sw=4:expandtab
3 # Regression test: when only having a floating window on a workspace, it should not be deleted.
9 use_ok('X11::XCB::Window');
12 my $i3 = i3(get_socket_path());
14 my $tmp = fresh_workspace;
16 #############################################################################
17 # 1: open a floating window, get it mapped
18 #############################################################################
20 ok(workspace_exists($tmp), "workspace $tmp exists");
22 my $x = X11::XCB::Connection->new;
24 # Create a floating window which is smaller than the minimum enforced size of i3
25 my $window = open_floating_window($x);
26 ok($window->mapped, 'Window is mapped');
28 # switch to a different workspace, see if the window is still mapped?
30 my $otmp = fresh_workspace;
32 ok(workspace_exists($otmp), "new workspace $otmp exists");
33 ok(workspace_exists($tmp), "old workspace $tmp still exists");
35 ################################################################################
36 # 2: Similar test: Have two floating windows on a workspace, close one of them.
37 # The workspace should not be closed. Regression present until (including) commit
38 # 1f2c9306a27cced83ad960e929bb9e9a163b7843
39 ################################################################################
41 $tmp = fresh_workspace;
43 ok(workspace_exists($tmp), "workspace $tmp exists");
45 # Create a floating window which is smaller than the minimum enforced size of i3
46 my $first = open_floating_window;
47 my $second = open_floating_window;
48 ok($first->mapped, 'Window is mapped');
49 ok($second->mapped, 'Window is mapped');
51 $otmp = fresh_workspace;
53 ok(workspace_exists($otmp), "new workspace $otmp exists");
54 ok(workspace_exists($tmp), "old workspace $tmp still exists");
57 wait_for_unmap $first;
59 ok(workspace_exists($otmp), "new workspace $otmp exists");
60 ok(workspace_exists($tmp), "old workspace $tmp still exists");