]> git.sur5r.net Git - i3/i3/blobdiff - testcases/t/135-floating-focus.t
Raise floating window to top when it gets focus
[i3/i3] / testcases / t / 135-floating-focus.t
index f23dabae444661ccd2a6b8398c8803b6ffa1cbe8..f21c0486ee1bf47268ed1a27531a0d565c2a0254 100644 (file)
@@ -216,4 +216,28 @@ cmd 'focus child';
 
 is($x->input_focus, $floating->id, 'floating window focused');
 
+#############################################################################
+# 8: verify that focusing a floating window raises it to the top.
+# This test can't verify that the floating container is visually on top, just
+# that it is placed on the tail of the floating_head.
+# See issue: 2572
+#############################################################################
+
+$tmp = fresh_workspace;
+
+$first = open_floating_window;
+$second = open_floating_window;
+
+is($x->input_focus, $second->id, 'second floating window focused');
+my $ws = get_ws($tmp);
+is($ws->{floating_nodes}->[1]->{nodes}->[0]->{window}, $second->id, 'second on top');
+is($ws->{floating_nodes}->[0]->{nodes}->[0]->{window}, $first->id, 'first behind');
+
+cmd '[id=' . $first->id . '] focus';
+
+is($x->input_focus, $first->id, 'first floating window focused');
+$ws = get_ws($tmp);
+is($ws->{floating_nodes}->[1]->{nodes}->[0]->{window}, $first->id, 'first on top');
+is($ws->{floating_nodes}->[0]->{nodes}->[0]->{window}, $second->id, 'second behind');
+
 done_testing;