Refactor tree_next
- Makes `tree_next` not recursive. - Adds `focus next|prev [sibling]` command. See (1.) and (2.) in https://github.com/i3/i3/issues/2587#issuecomment-378505551 (Issue also requests move command, not implemented here). - Directional focus command now supports command criteria. Wrapping is not implemented inside a floating container. This was also true before the refactor so I am not changing it here.
This commit is contained in:
committed by
Orestis Floros
parent
f402f45702
commit
bbc4c99c72
@ -35,9 +35,13 @@ my $bottom = open_window;
|
||||
# end sleeping for half a second to make sure i3 reacted
|
||||
#
|
||||
sub focus_after {
|
||||
my $msg = shift;
|
||||
my ($msg, $win_id) = @_;
|
||||
|
||||
cmd $msg;
|
||||
if (defined($win_id)) {
|
||||
cmd "[id=$win_id] $msg";
|
||||
} else {
|
||||
cmd $msg;
|
||||
}
|
||||
return $x->input_focus;
|
||||
}
|
||||
|
||||
@ -50,6 +54,14 @@ is($focus, $mid->id, "Middle window focused");
|
||||
$focus = focus_after('focus up');
|
||||
is($focus, $top->id, "Top window focused");
|
||||
|
||||
# Same using command criteria
|
||||
$focus = focus_after('focus up', $bottom->id);
|
||||
is($focus, $mid->id, "Middle window focused");
|
||||
|
||||
cmd 'focus down';
|
||||
$focus = focus_after('focus up', $mid->id);
|
||||
is($focus, $top->id, "Top window focused");
|
||||
|
||||
#####################################################################
|
||||
# Test focus wrapping
|
||||
#####################################################################
|
||||
|
Reference in New Issue
Block a user