All pastes #235599 Raw Edit

Someone

public text v1 · immutable
·published 2006-11-03 10:04 UTC
rendered paste body
Index: src/plugin.c
===================================================================
--- src/plugin.c	(Revision 987)
+++ src/plugin.c	(Arbeitskopie)
@@ -697,9 +702,8 @@
    CompOption *o;
    CompPlugin *p, *prev = NULL;
    int i, j, old_num = 0, new_num = 0;
+   Bool settingsLoaded = FALSE;
 
-   o = &d->opt[COMP_DISPLAY_OPTION_ACTIVE_PLUGINS];
-
    /* Unload by default. */
    pr_debug("Pop: ");
    p = plugins;
@@ -709,6 +713,7 @@
        if (!strcmp(p->vTable->name,"settings"))
        {
            p->state = BerylPluginReady;
+	   settingsLoaded = TRUE;
        }
        else
        {
@@ -721,6 +726,25 @@
 
    pr_debug("Old number of plugins is %d.\n", old_num);
 
+   /* first load settings plugin (unconditionally) upon
+    * first startup to get the list of plugins to be 
+    * activated 
+    * if it wasn't loaded before, unload after that 
+    */
+   
+   if (!settingsLoaded) {
+       CompPlugin *settPlugin;
+       settPlugin = loadPlugin("settings", d);
+       pr_debug("initially loaded settings plugin (%p)\n", settPlugin);
+       if (settPlugin) {
+	   initPlugin(settPlugin);
+	   finiPlugin(settPlugin);
+           unloadPlugin(settPlugin, d);
+       }
+   }
+
+   o = &d->opt[COMP_DISPLAY_OPTION_ACTIVE_PLUGINS];
+
    /* 
     * Now mark names still in the list as ok, and
     * find how many plugins we'll have in the new