Fix scratchpad double reap and redundant parent operations - #9196
Open
jbms wants to merge 1 commit into
Open
Conversation
Also fix redundant parent operations.
jbms
force-pushed
the
fix-scratchpad-double-reap
branch
from
June 26, 2026 04:15
930c30c to
e08f31c
Compare
Contributor
I don't see that change in the diff. Is this perhaps an outdated description? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_containercallscontainer_set_floating, which detaches the container from its tiled parent and reaps the parent if it becomes empty.However,
root_scratchpad_add_containerwas then:container_reap_emptyon the parent again, causing a redundant/double-reap.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:
container_reap_empty(parent)call, as the parent is already reaped incontainer_set_floating(if it was tiled) or it is NULL (if it was already floating).parent->node.destroyingflag directly to verify if the parent container is being destroyed. If it is being destroyed, we setparenttoNULLto avoid arranging it, falling back to arranging the workspace instead.