diff --git a/sway/tree/root.c b/sway/tree/root.c index 22c46aba..e1624863 100644 --- a/sway/tree/root.c +++ b/sway/tree/root.c @@ -145,7 +145,7 @@ void root_scratchpad_hide(struct sway_container *con) { container_detach(con); arrange_workspace(ws); - if (&con->node == focus) { + if (&con->node == focus || node_has_ancestor(focus, &con->node)) { seat_set_focus(seat, seat_get_focus_inactive(seat, &ws->node)); } list_move_to_end(root->scratchpad, con);