Don't raise floating windows when focused because of focus_follows_mouse

Fixes #2990.
This commit is contained in:
Orestis Floros
2017-12-06 01:58:47 +02:00
parent 2b5b6330dc
commit 0c2fbeedc2
15 changed files with 99 additions and 51 deletions

View File

@ -57,4 +57,32 @@ is($x->input_focus, $second->id, 'second (tabbed) window focused');
synced_warp_pointer(0, 0);
is($x->input_focus, $second->id, 'second window still focused');
###################################################################
# Test that floating windows are focused but not raised to the top.
# See issue #2990.
###################################################################
my $ws;
my $tmp = fresh_workspace;
my ($first_floating, $second_floating);
synced_warp_pointer(0, 0);
$first_floating = open_floating_window;
$first_floating->rect(X11::XCB::Rect->new(x => 1, y => 1, width => 100, height => 100));
$second_floating = open_floating_window;
$second_floating->rect(X11::XCB::Rect->new(x => 50, y => 50, width => 100, height => 100));
sync_with_i3;
$first = open_window;
is($x->input_focus, $first->id, 'first (tiling) window focused');
$ws = get_ws($tmp);
is($ws->{floating_nodes}->[1]->{nodes}->[0]->{window}, $second_floating->id, 'second floating on top');
is($ws->{floating_nodes}->[0]->{nodes}->[0]->{window}, $first_floating->id, 'first floating behind');
synced_warp_pointer(40, 40);
is($x->input_focus, $first_floating->id, 'first floating window focused');
$ws = get_ws($tmp);
is($ws->{floating_nodes}->[1]->{nodes}->[0]->{window}, $second_floating->id, 'second floating still on top');
is($ws->{floating_nodes}->[0]->{nodes}->[0]->{window}, $first_floating->id, 'first floating still behind');
done_testing;