Colin Guthrie <[EMAIL PROTECTED]> writes:

> Hi,
>
> Now that --with-default-plugins has gone in compiz 0.5.1 (git), I was
> looking for an alternative.
>
> Although I've personally been using ccp and am quite happy with the GUI
> tools now (so it will probably become default in my packages), I was
> still looking for a way to define the default plugins uses if a gconf
> backend was used.
>
> So I patched core.xml.in as follows:
> --- a/metadata/core.xml.in
> +++ b/metadata/core.xml.in
> @@ -7,6 +7,23 @@
>                 <_short>Active Plugins</_short>
>                 <_long>List of currently active plugins</_long>
>                 <type>string</type>
> +               <default>
> +                   <value>decoration</value>
[...]
> +                   <value>dbus</value>
> +               </default>
>             </option>
>             <option name="texture_filter" type="int">
>                 <_short>Texture Filter</_short>
>
> This kinda worked but not quite!
>
> All the plugins bar the first two are loaded fine (on a fresh user
> account). So what happened to the first two?

When running "compiz gconf", compiz first initializes the command line
plugins in display.c:updatePlugins() (display options have been
initialized from core metadata options which contains command line
options).

This function loads successively the plugins, and updates an internal
plugins list each time a plugin is loaded.

When the gconf plugin is initially loaded, it runs an intialization
function which loads all settings from the gconf registry, including
the "active_plugins" key. This routine also runs d->setDisplayOption,
from gconf.c:gconfGetOptionValue(). So, after the gconf plugin init,
d->opt[COMP_DISPLAY_OPTION_ACTIVE_PLUGINS] will look like:
[decoration,png,wobbly,...]

Back to the initial function, after a plugin is loaded, the
internal plugins list d->plugin.list gets updated:
[gconf]

But then, the for loop continues, since
d->opt[COMP_DISPLAY_OPTION_ACTIVE_PLUGINS] contains more values (that
were loaded from gconf).
At the end of the loop, d->plugin.list will look like:
[gconf,png,wobbly,...]

And finally, at the end of display.c:updatePlugins(), d->plugin gets
copied back to d->opt[COMP_DISPLAY_OPTION_ACTIVE_PLUGINS]


I tried to workaround this by stopping the loading loop as soon as a
plugin makes the pluginlist dirty, and by not overwriting again the
pluginslist if it is marked as dirty (see attached patch). Then, the
plugin list will get reloaded, since it is marked as dirty.

--- compiz-0.5.2-orig/src/display.c	2007-08-06 23:40:00.000000000 +0200
+++ compiz-0.5.2/src/display.c	2007-08-06 23:47:54.000000000 +0200
@@ -961,6 +967,8 @@
 		    p = 0;
 		}
 	    }
+	    if (d->dirtyPluginList)
+		break;
 	}
 
 	if (p)
@@ -993,7 +1002,8 @@
     if (nPop)
 	free (pop);
 
-    (*d->setDisplayOption) (d, o->name, &d->plugin);
+    if (!d->dirtyPluginList)
+	(*d->setDisplayOption) (d, o->name, &d->plugin);
 }
 
 static void
This solves the issue at start, but also adds an unfortunate drawback:
the gconf plugin is not listed anymore in the plugins list, and does
not get uninitialized at stop (provoking a segfault here).

Another solution could be to make the gconf plugin add itself in the
plugin list, but this is a lot more hackish.

Any other suggestions welcome.

-- 
Olivier Blin - Mandriva
_______________________________________________
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz

Reply via email to