[compiz] solving plugin dependency issues

Guillaume ixcemix at gmail.com
Sat Oct 7 16:12:55 PDT 2006


Here's my implementation of your great idea. It adds
CompPluginRuleRequire, that allows a plugin to depend on a feature,
and two items in the plugin VTable, features and nFeatures. I know I
could have merged the features and the dependencies systems, but it
looks much cleaner (a feature is not actually a dep).
Plugins have been modified consequently (adding the new VTable items),
and Cube, Plane and Zoom plugins now use the new Features code.
I did my best to follow your coding style and indentation guidelines,
hopefully it'll fit your requirements.
As a side note, I'd suggest removing the "Can't activate plugin due to
dependency problems" fprintf, since it's just repeating the error
already printed in checkPluginDeps function.

Guillaume Seguin

2006/10/7, Guillaume <ixcemix at gmail.com>:
> Hello,
> We already done something similar in beryl to fix these conflicting
> plugins issues. What we did was to introduce two new rules,
> CompPluginRuleConflicts and CompPluginRuleAfterAlt. The first one
> prevents two incompatible plugin from being loaded at once, and the
> later one allows a plugin to require only one plugin in a list of
> alternatives.
> Anyway, I really like your Feature idea, it's probably the best way to
> handle such problems, and it'd be much more flexible than my silly
> alternatives rule (since with Features one plugin may need several
> Features).
> About the implementation, I just wonder if it'd be better to extend
> the current Dependencies system with two new rules
> (CompPluginRuleProvideFeature and CompPluginRuleNeedFeature) or extend
> the plugin API as you suggested. Both approachs sound acceptable.
> If you're ok with that, I'll write a first draft tomorrow.
> Regards,
> Guillaume Seguin
> 2006/10/7, David Reveman <davidr at novell.com>:
> > The dependency checking currently provided is clearly not good enough.
> > There's currently two issues with the plugins that exist in the compiz
> > repository.
> >
> > plane plugin conflicts with cube and rotate plugin, zoom plugin should
> > probably work with either cube or plane but currently only loads when
> > cube plugin is used.
> >
> > Adding a
> > { CompPluginRuleBefore, "cube" }
> > to the plane plugin and a
> > { CompPluginRuleBefore, "plane" }
> > to the cube plugin will solve the conflict but it's not perfect as it
> > means that all plugins sort of needs to be aware of all other plugins.
> >
> > Having the zoom plugin load if either the cube plugin or the plane
> > plugin is loaded is currently not possible.
> >
> > I'm suggesting that we add some way to register and depend on features.
> > E.g. the cube and plane plugins would both register a "largedesktop"
> > feature. zoom plugin could depend on the "largedesktop" feature instead
> > of the cube plugin and it wouldn't be possible to load two plugins that
> > provide the same feature.
> >
> > Adding a feature list to the plugin vTable and a
> > CompPluginRuleNeedFeature rule that can be used to depend on specific
> > features should do it.
> >
> > -David
> >
> > _______________________________________________
> > compiz mailing list
> > compiz at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/compiz
> >
-------------- next part --------------
A non-text attachment was scrubbed...
Name: plugin-features.patch
Type: text/x-patch
Size: 10763 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/compiz/attachments/20061008/452d4c67/plugin-features.bin

More information about the compiz mailing list