aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
authorsiikamiika <siikamiika@users.noreply.github.com>2021-10-10 01:57:48 +0300
committerRonan Pigott <rpigott@berkeley.edu>2021-10-21 13:13:54 -0700
commit197d0ab82f64ea9a96786e55e375c930389aa85b (patch)
treecefd1cd3419865c26bc258a31ee39ac4e129edf9 /sway
parent215787e8b28d4e52d97bdcadd4b64305c7a62ac5 (diff)
commands/focus: focus view inside container
seat_get_focus_inactive_floating and seat_get_focus_inactive_tiling do not always return a view, so get the previously focused view from the container with seat_get_focus_inactive_view. This is the i3 behavior.
Diffstat (limited to 'sway')
-rw-r--r--sway/commands/focus.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sway/commands/focus.c b/sway/commands/focus.c
index 6771ca2f..ceb43d45 100644
--- a/sway/commands/focus.c
+++ b/sway/commands/focus.c
@@ -267,6 +267,11 @@ static struct cmd_results *focus_mode(struct sway_workspace *ws,
new_focus = seat_get_focus_inactive_tiling(seat, ws);
}
if (new_focus) {
+ struct sway_container *new_focus_view =
+ seat_get_focus_inactive_view(seat, &new_focus->node);
+ if (new_focus_view) {
+ new_focus = new_focus_view;
+ }
seat_set_focus_container(seat, new_focus);
// If we're on the floating layer and the floating container area