Skip to content

Commit

Permalink
transaction: Reparent all container children when disabling for scrat…
Browse files Browse the repository at this point in the history
…chpad

Fixes: #8205
  • Loading branch information
Nefsen402 authored and emersion committed Aug 4, 2024
1 parent 6e4ccb9 commit b881c2e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions sway/desktop/transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,15 @@ static void arrange_root(struct sway_root *root) {
for (int i = 0; i < root->scratchpad->length; i++) {
struct sway_container *con = root->scratchpad->items[i];

// When a container is moved to a scratchpad, it's possible that it
// was moved into a floating container as part of the same transaction.
// In this case, we need to make sure we reparent all the container's
// children so that disabling the container will disable all descendants.
if (!con->view) for (int ii = 0; ii < con->current.children->length; ii++) {
struct sway_container *child = con->current.children->items[ii];
wlr_scene_node_reparent(&child->scene_tree->node, con->content_tree);
}

wlr_scene_node_set_enabled(&con->scene_tree->node, false);
}

Expand Down

0 comments on commit b881c2e

Please sign in to comment.