Skip to content

Fix scratchpad double reap and redundant parent operations - #9196

Open
jbms wants to merge 1 commit into
swaywm:masterfrom
jbms:fix-scratchpad-double-reap
Open

Fix scratchpad double reap and redundant parent operations#9196
jbms wants to merge 1 commit into
swaywm:masterfrom
jbms:fix-scratchpad-double-reap

Conversation

@jbms

@jbms jbms commented Jun 22, 2026

Copy link
Copy Markdown

This commit fixes a double-reap and redundant operations when sending a tiled container to the scratchpad.
When the container is tiled, root_scratchpad_add_container calls container_set_floating, which detaches the container from its tiled parent and reaps the parent if it becomes empty.
However, root_scratchpad_add_container was then:

  1. Calling container_reap_empty on the parent again, causing a redundant/double-reap.
  2. Calling arrange_container(parent) on the parent even if it has already been marked for destruction and is about to be reaped.

We fix this by:

  1. Removing the redundant container_reap_empty(parent) call, as the parent is already reaped in container_set_floating (if it was tiled) or it is NULL (if it was already floating).
  2. Checking the parent->node.destroying flag directly to verify if the parent container is being destroyed. If it is being destroyed, we set parent to NULL to avoid arranging it, falling back to arranging the workspace instead.

Also fix redundant parent operations.
@jbms
jbms force-pushed the fix-scratchpad-double-reap branch from 930c30c to e08f31c Compare June 26, 2026 04:15
@smlx

smlx commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Removing the redundant container_reap_empty(parent) call, as the parent is already reaped in container_set_floating (if it was tiled) or it is NULL (if it was already floating).

I don't see that change in the diff. Is this perhaps an outdated description?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants