Hi all,
I have a problem in properly understanding the WRAP and UNWRAP macros - or maybe discovered a design flaw in it.
If the WRAP macro is called, the original function pointer from the screen/display structure (I will from now on reference it as screen for simplicity) is taken, placed into the plugins' private structure and replaced by the plugin function pointer.
So after 3 plugins being loaded, the situation looks as follows:
s->funcPointer = plugin3WrapPointer
<plugin1private>->funcPointer = origPointer
<plugin2private>->funcPointer = plugin1WrapPointer
<plugin3private>->funcPointer = plugin2WrapPointer
(Please correct me, if I'm wrong ;-) )
Now assume one wants to unload plugin1. What's happening then is
s->funcPointer = <plugin1private>->funcPointer
so after that, s->funcPointer will be origPointer - thus unhooking all the other plugins from the chain, too.
So now my question is: Did I get the theory completely wrong, was compiz designed to not support dynamic unloading or is there some other problem?
Thanks for the enlightenment ;-)
Regards,
Danny