From f0731de2d38e36e61b6cbd1cde88a7a5c8c01d90 Mon Sep 17 00:00:00 2001 From: Hugo Osvaldo Barrera Date: Tue, 7 Jan 2025 15:21:05 +0100 Subject: [PATCH] Properly focus container when it changes parent When a parented container changes parent, sway will render a sibling non-focused container. Revert deletion of code which introduced this regression. Fixes: 5e18ed3cf03eee9e83909fede46dd98dff652647 Fixes: https://github.com/swaywm/sway/issues/8292 --- sway/commands/move.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sway/commands/move.c b/sway/commands/move.c index 8891514cef..5c9df2b3a4 100644 --- a/sway/commands/move.c +++ b/sway/commands/move.c @@ -770,6 +770,10 @@ static struct cmd_results *cmd_move_in_direction( ipc_event_window(container, "move"); } + // Re-focus re-parented container. + seat_set_raw_focus(config->handler_context.seat, &new_ws->node); + seat_set_focus_container(config->handler_context.seat, container); + container_end_mouse_operation(container); return cmd_results_new(CMD_SUCCESS, NULL);