keep parent canvas referenced from cloned instance #972
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.
After creating a cloned instance, the reference to its parent canvas is currently cleared:
pure-data/src/g_clone.c
Line 213 in 8092921
This PR proposes to keep this
gl_owner
reference intact, and use glist's fieldgl_isclone
instead for discriminating clones when needed.It allows a clone instance to behave just like any abstraction, and in particular it makes possible to:
Window / Parent Window
[pdcontrol]
to retrieve parents information through[dir N(
and[args N(
I basically replaced:
if (x->gl_owner)
with:
if (x->gl_owner && !x->gl_isclone)
where relevant.
(EDIT: I had previously forbidden [pdcontrol] to go back to clone's parent and retrieve its info, which wasn't necessary... I reverted that).