]> git.sur5r.net Git - i3/i3/blobdiff - testcases/t/129-focus-after-close.t
Merge branch 'master' into next
[i3/i3] / testcases / t / 129-focus-after-close.t
index df226e84070bf826d9667af576b218df9a13382f..2ebfd61022012c5a913b53a53f614ba260f91d68 100644 (file)
@@ -119,6 +119,55 @@ sync_with_i3;
 
 is(get_focused($tmp), $middle, 'middle container focused');
 
+##############################################################
+# check if the workspace container can be closed
+##############################################################
+
+$tmp = fresh_workspace;
+
+my $window = open_window();
+
+# one window opened on the current workspace
+($nodes, $focus) = get_ws_content($tmp);
+is(scalar @$nodes, 1, 'workspace contains one node');
+
+# focus the workspace
+cmd "focus parent";
+cmd "focus parent";
+
+# try to kill the workspace
+cmd "kill";
+sync_with_i3;
+
+# the workspace should now be empty
+($nodes, $focus) = get_ws_content($tmp);
+is(scalar @$nodes, 0, 'workspace is empty');
+
+################################################################################
+# check if killing a workspace also closes floating windows.
+################################################################################
+
+$tmp = fresh_workspace;
+
+$window = open_window;
+my $floating_window = open_floating_window;
+
+# one window opened on the current workspace
+($nodes, $focus) = get_ws_content($tmp);
+is(scalar @$focus, 2, 'workspace contains two nodes');
+
+# focus the workspace
+cmd "focus parent";
+cmd "focus parent";
+
+# try to kill the workspace
+cmd "kill";
+sync_with_i3;
+
+# the workspace should now be empty
+($nodes, $focus) = get_ws_content($tmp);
+is(scalar @$focus, 0, 'workspace is empty');
+
 ##############################################################
 # and now for something completely different:
 # check if the pointer position is relevant when restoring focus