]> git.sur5r.net Git - i3/i3/blobdiff - testcases/t/129-focus-after-close.t
tree_move: Don't change focus order when swapping containers
[i3/i3] / testcases / t / 129-focus-after-close.t
index 8d9ccbb9e7662ecf9810a9fdd021ea06f0e60b17..8bfa0140fc2fb9bdf94df3bb440ffcddf0a901b5 100644 (file)
@@ -2,13 +2,13 @@
 # vim:ts=4:sw=4:expandtab
 #
 # Please read the following documents before working on tests:
-# • http://build.i3wm.org/docs/testsuite.html
+# • https://build.i3wm.org/docs/testsuite.html
 #   (or docs/testsuite)
 #
-# • http://build.i3wm.org/docs/lib-i3test.html
+# • https://build.i3wm.org/docs/lib-i3test.html
 #   (alternatively: perldoc ./testcases/lib/i3test.pm)
 #
-# • http://build.i3wm.org/docs/ipc.html
+# • https://build.i3wm.org/docs/ipc.html
 #   (or docs/ipc)
 #
 # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
@@ -143,6 +143,31 @@ sync_with_i3;
 ($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