plugins: Add early_initialize vfunc

For GNOME Shell, we need to grab our DBus names *before* we talk XSMP.
gnome-session takes our XSMP connection as "I'm ready", and starts
running all the other random crud that people dropped in as autostart
files.  But for example, we need to have claimed
org.freedesktop.Notifications before a lot of said crud starts.

This requires a plugin API version bump.

Misc: Move handling of --version way earlier in main() where
it should be; no point having it wedged after plugin handling.
This commit is contained in:
Colin Walters
2011-02-25 14:38:04 -05:00
parent 183190d089
commit f2158218be
5 changed files with 55 additions and 5 deletions

View File

@ -539,6 +539,9 @@ main (int argc, char **argv)
/* Parse command line arguments.*/
ctx = meta_parse_options (&argc, &argv, &meta_args);
if (meta_args.print_version)
version ();
/* This must come before the introspect below, so we load all the plugins
* in order to get their get_type functions.
*/
@ -587,10 +590,18 @@ main (int argc, char **argv)
}
#endif
meta_set_syncing (meta_args.sync || (g_getenv ("MUTTER_SYNC") != NULL));
/* Early initialization for plugins comes before almost anything
else here */
{
MetaPluginManager *mgr = meta_plugin_manager_get_default ();
if (meta_args.print_version)
version ();
if (!meta_plugin_manager_load (mgr))
g_error ("failed to load plugins");
meta_plugin_manager_initialize_early (mgr);
}
meta_set_syncing (meta_args.sync || (g_getenv ("MUTTER_SYNC") != NULL));
meta_select_display (meta_args.display_name);