From 197d0ab82f64ea9a96786e55e375c930389aa85b Mon Sep 17 00:00:00 2001 From: siikamiika Date: Sun, 10 Oct 2021 01:57:48 +0300 Subject: 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. --- sway/commands/focus.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sway/commands/focus.c') 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 -- cgit v1.2.3 From cd1a0aa29358cbc9f18517807cd9b329b67dd526 Mon Sep 17 00:00:00 2001 From: Patrick Hilhorst Date: Mon, 22 Nov 2021 19:44:22 +0100 Subject: treat fullscreen windows as 'tiled' for commands/focus (cherry picked from commit b2ee964434b25a0ccbccb1486b027f69ef34acff) --- sway/commands/focus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sway/commands/focus.c') diff --git a/sway/commands/focus.c b/sway/commands/focus.c index ceb43d45..b8d28480 100644 --- a/sway/commands/focus.c +++ b/sway/commands/focus.c @@ -451,7 +451,8 @@ struct cmd_results *cmd_focus(int argc, char **argv) { return cmd_results_new(CMD_FAILURE, ""); } struct sway_node *next_focus = NULL; - if (container_is_floating(container)) { + if (container_is_floating(container) && + container->pending.fullscreen_mode == FULLSCREEN_NONE) { next_focus = node_get_in_direction_floating(container, seat, direction); } else { next_focus = node_get_in_direction_tiling(container, seat, direction, descend); -- cgit v1.2.3