summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar siikamiika <siikamiika@users.noreply.github.com>2021-10-10 01:57:48 +0300
committerLibravatar Ronan Pigott <rpigott@berkeley.edu>2021-10-21 13:13:54 -0700
commit197d0ab82f64ea9a96786e55e375c930389aa85b (patch)
treecefd1cd3419865c26bc258a31ee39ac4e129edf9
parentxwayland: Clear wlr_xwayland_surface in handle_destroy (diff)
downloadsway-197d0ab82f64ea9a96786e55e375c930389aa85b.tar.gz
sway-197d0ab82f64ea9a96786e55e375c930389aa85b.tar.zst
sway-197d0ab82f64ea9a96786e55e375c930389aa85b.zip
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,
267 new_focus = seat_get_focus_inactive_tiling(seat, ws); 267 new_focus = seat_get_focus_inactive_tiling(seat, ws);
268 } 268 }
269 if (new_focus) { 269 if (new_focus) {
270 struct sway_container *new_focus_view =
271 seat_get_focus_inactive_view(seat, &new_focus->node);
272 if (new_focus_view) {
273 new_focus = new_focus_view;
274 }
270 seat_set_focus_container(seat, new_focus); 275 seat_set_focus_container(seat, new_focus);
271 276
272 // If we're on the floating layer and the floating container area 277 // If we're on the floating layer and the floating container area