[compiz] Dbus plugin problem: Setting reset

Danny Baumann dannybaumann at web.de
Tue May 15 08:36:39 PDT 2007


Hi,

> > I finally have found the reason for the problem: It is wrapping into
> > initPluginFor(Display|Screen) while executing initPluginFor(Display|
> > Screen).
> > Let me show this with the call stack. 'storage' in this example is the
> > option storage plugin.
> > 
> > - d->initPluginForDisplay (plugin.c:300) is called at some point for the
> > storage plugin
> > - this calls core's initPluginForDisplay, which calls initDisplay
> > (plugin.c:189)
> > - storage WRAPs into initPluginForDisplay
> > - initPluginForDisplay is called for the next plugin (e.g. dbus ;-) )
> > - storageInitPluginForDisplay is called
> > - storage UNWRAPs
> > - core's initPluginForDisplay is called
> > - initDisplay for the plugin is called
> > - plugin WRAPs into initPluginForDisplay
> > - storage WRAPs into initPluginForDisplay again
> > 
> > This is the reason why the pointer to storageInitPluginForDisplay will
> > get lost afterwards and newly loaded plugins thus won't get their
> > settings initialized. 
> > 
> > So in short: We are WRAPping a function while executing it, which is
> > bad(TM). Does anyone have a suggestion how to fix it?
> 
> Yes, that's bad. The appropriate fix seems to be to move the plugin
> initialization out of initPluginForDisplay and initPluginForScreen. I've
> attached a patch that does this, let me know how it works.

A quick testing shows it's working fine. Before I could reproduce the
problem in 100% of all cases, after that it's gone. The fix also looks
pretty obvious once you see it ;-)

Thanks,

Danny



More information about the compiz mailing list