On Tue, Mar 01, 2005 at 04:03:17PM +0100, Matthieu Moy wrote: > Actually, I think the hook is not called in the right place. It's > confusing for the programmer to get this callback "during a detach". > Perhaps there should be a pre- and a post- hook (if the post- hook is > possible, given the asynchrony of some ion functions. I don't know > enough about ion's internals to answer).
I see essentially two solutions to the matter: 1. Defer calling the hook functions until the mainloop. Things that destroy objects, such as WRegion.rqclose, already do this. In this case I'd like to do the same with a few other hooks as well that are not supposed to go modifying anything. Unfortunately this is not possible in all cases. Another problem is that some of the parameters will have at times been destroyed by the time the hook gets called. 2. Enter hooks that are not supposed to modify anything in a "protected mode". This works for all hooks (and could replace the lists of safe functions for resize and tabdrag mode), but is a lot more work, one having to go through all the exports and see which ones should not work in protected mode. Also it is a bit ugly that a function can fail at run time being attempted to be called in protected mode. Simply deferring calling things is cleaner in this sense. I don't yet know which solution I prefer. -- Tuomo
