Ok ... I think I fixed all the bugs in CompositeNodeObserver, so I've comitted my patch. I've not gone through and verified that it fixes all the layer etc. bugs yet, but if it doesn't it should at least make the remaining work of fixing them much easier.
The commit ensures that two of my "five invariants" are now observed:
* a listener should not receive events that occurred before its registration
* a listener should not receive any events at all once it is deregistered
Hmm, and actually also that "fifth and a half" invariant: it should be safe for a listener to unregister itself.
The patch also had the effect of disabling the 'is_interactive' flag for attribute changes. However, the work I'd done since it had been introduced made a (much cleaner!) replacement very easy.
[ I've not actually entirely purged the is_interactive flag yet, since that will require changing a lot of files, but I will do so once we're satisfied that these changes are working out. ]
I've been testing most of the night, but please test yourself and see if you turn up anything. I'm still worried that some code somewhere was written that inadvertantly depended on a violation of the first invariant above.
-mental