Raise floating window to top when it gets focus
Applied for: 1. '[...] focus' for a floating container raises it to the top. 2. Focusing a window through a focus event raises it to the top. Fixes #2572
This commit is contained in:
committed by
Michael Stapelberg
parent
683e33199d
commit
8653bfe8d3
@ -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;
|
||||
|
Reference in New Issue
Block a user