-
Notifications
You must be signed in to change notification settings - Fork 238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
closebang bug fixes #596
base: master
Are you sure you want to change the base?
closebang bug fixes #596
Conversation
@umlaeute gentle reminder ;-) |
@umlaeute if you have time, it would be great if you could have a look, since this PR is mainly aimed at |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fine by me.
Would it work to change canvas_loadbang(t_canvas *x) to canvas_loadbang(t_canvas *x, t_floatarg action) where |
We can't really send the "closebang" from within |
6017ffe
to
2eedd44
Compare
I think this should be done differently by writing a unifying function that can recurse into all patces/subpatches with options to go depth-first and/or cancel going into abstractions/clones and/or only report the first one after a given match and perhaps others as needed to support find, loadbang, closebang, and all that. I'm afraid that putting features in piecemeal for 0.52 will make that harder to do compatibly in the future, so I propose to try to get this running after 0.52 goes out (hopefully ready to 'test' very soon). |
Ok! I'll keep this PR open just as a reference for the "correct" closebang behavior. Once you've implemented your solution, it can be closed. |
On a second thought, unified canvas traversal is just an implementation detail, the actual feature (= behavior) would be the same. So I don't really understand what you mean by "putting features in piecemeal". Specifically, if you merge this PR, you would later only need to change the implementation of I think it could be helpful to have the right behavior in place before doing all the refactoring. But that's just my opinion. Do whatever you feel more comfortable with :-) |
2eedd44
to
c7e9a1a
Compare
this makes sure that closebang is called in the same sequence as loadbang (and initbang)
…itly requested the original glist_delete() is now a wrapper around glist_dodelete() which calls canvas_closebang(). this is done to maintain backwards compatibility with existing externals which use the private canvas API.
… want to emit a closebang (again): * graph_delete (a subpatch is deleted) * canvas_free (a root canvas/abstraction is freed)
when a root canvas is closed, we want to send a closebang to all children, in the same order as loadbang. this also fixes a bug where [iemguts/closebang] wouldn't work on the toplevel root canvas.
instead emit the closebangs in glist_delete()
c7e9a1a
to
cee3df8
Compare
the current ordering is messy because when an object receives a closebang, other objects might have already been destroyed. so if you want to save a table with [closebang] for example, you have to put it into the right place in the glist (the details are complicated). here's a patch which demonstrates the problem:
closebang-issue.zip
what I would want instead is that no object is actually deleted unless all closebang messages have been sent, so I don't have worry about where I put my [closebang] objects.
don't send closebang twice to cloned abstractions
fix a bug where non-canvas objects on the root canvas wouldn't receive a closebang message.
externals which use
glist_delete
from the private canvas API still work as expected.the
[clear(
message also works.cutting objects is ok but
canvas_closebang
is called on every selected canvas in series - which means the closebang order is only correct for each selected canvas. otoh, it's the same with loadbang and initbang when pasting multiple canvases, so at least its consistent. later we might want to fix the initialization order for cut&paste...here's a test patch (needs [iemguts] with a version before 2018):
closebang-test.zip
needs review from @umlaeute (see also https://git.iem.at/pd/iemguts/issues/8)