]> git.sur5r.net Git - i3/i3/blobdiff - testcases/t/135-floating-focus.t
Skip floating cons in focus (child|parent) and stop them from being split
[i3/i3] / testcases / t / 135-floating-focus.t
index c7218130166f082f22a8dcd2a991df3fcc000fc7..f23dabae444661ccd2a6b8398c8803b6ffa1cbe8 100644 (file)
@@ -1,5 +1,18 @@
 #!perl
 # vim:ts=4:sw=4:expandtab
+#
+# Please read the following documents before working on tests:
+# • http://build.i3wm.org/docs/testsuite.html
+#   (or docs/testsuite)
+#
+# • http://build.i3wm.org/docs/lib-i3test.html
+#   (alternatively: perldoc ./testcases/lib/i3test.pm)
+#
+# • http://build.i3wm.org/docs/ipc.html
+#   (or docs/ipc)
+#
+# • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
+#   (unless you are already familiar with Perl)
 
 use i3test;
 
@@ -184,4 +197,23 @@ cmd 'focus right';
 
 is($x->input_focus, $second->id, 'focus on second container');
 
+#############################################################################
+# 7: verify that focusing the parent of a window inside a floating con goes
+# up to the grandparent (workspace) and that focusing child from the ws
+# goes back down to the child of the floating con
+#############################################################################
+
+$tmp = fresh_workspace;
+
+my $tiled = open_window;
+my $floating = open_floating_window;
+is($x->input_focus, $floating->id, 'floating window focused');
+
+cmd 'focus parent';
+
+is(get_ws($tmp)->{focused}, 1, 'workspace is focused');
+cmd 'focus child';
+
+is($x->input_focus, $floating->id, 'floating window focused');
+
 done_testing;