_con_move_to_con: focus_next isn't always con_next_focused(con)

con_next_focused uses con's parent. But since con can be inside an
unfocused container this means that one of it's siblings could become
focused in the current workspace.
This commit is contained in:
Orestis Floros
2018-03-25 22:29:00 +03:00
parent f560519f5c
commit c7dde08673
2 changed files with 27 additions and 2 deletions

View File

@ -27,6 +27,7 @@ sub kill_and_confirm_focus {
}
my @windows;
my $ws;
sub focus_windows {
for (my $i = $#windows; $i >= 0; $i--) {
@ -122,4 +123,22 @@ $windows[0] = open_window;
cmd '[id=' . $windows[3]->id . '] move right';
confirm_focus('split-v + unfocused move');
######################################################################
# Test that moving an unfocused container from inside a split
# container to another workspace doesn't focus sibling.
######################################################################
$ws = fresh_workspace;
$windows[0] = open_window;
$windows[1] = open_window;
cmd 'split v';
open_window;
cmd 'mark a';
cmd '[id=' . $windows[0]->id . '] focus';
cmd '[con_mark=a] move to workspace ' . get_unused_workspace;
is(@{get_ws_content($ws)}, 2, 'Sanity check: marked window moved');
confirm_focus('Move unfocused window from split container');
done_testing;