summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2021-10-10 01:57:48 +0300
committerFurkan Sahin <furkan-dev@proton.me>2021-10-10 01:57:48 +0300
commitaa4ac31760f39ade20e0c8ba8fa1cc33b21241c8 (patch)
treecefd1cd3419865c26bc258a31ee39ac4e129edf9
parent8356a299a4d3ada3af39061b4592d828280ef95f (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.
-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