diff options
author | Emmanuele Bassi <ebassi@linux.intel.com> | 2010-01-05 17:20:24 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@linux.intel.com> | 2010-01-05 17:20:24 +0000 |
commit | 7b21f036b1dcbf23405291d274034524a42db4ac (patch) | |
tree | a4fca8095e8397d14f0f6f185d92a6eef572f702 | |
parent | 50af09dab8a1be33d1a69f440dbe85f5c71862ea (diff) | |
download | clutter-gtk-7b21f036b1dcbf23405291d274034524a42db4ac.tar.gz |
Register the Clutter option group as well
The gtk_clutter_init_with_args() registers the GTK+ option group and the
application's entries, but it doesn't register the Clutter option group.
Instead we should get all option groups, and parse them using our own
GOptionContext.
-rw-r--r-- | clutter-gtk/gtk-clutter-util.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/clutter-gtk/gtk-clutter-util.c b/clutter-gtk/gtk-clutter-util.c index c8a4f09..d075cfb 100644 --- a/clutter-gtk/gtk-clutter-util.c +++ b/clutter-gtk/gtk-clutter-util.c @@ -661,13 +661,26 @@ gtk_clutter_init_with_args (int *argc, const char *translation_domain, GError **error) { + GOptionGroup *gtk_group, *clutter_group; + GOptionContext *context; gboolean res; - res = gtk_init_with_args (argc, argv, - (char*) parameter_string, - entries, - (char*) translation_domain, - error); + /* we let gtk+ open the display */ + gtk_group = gtk_get_option_group (TRUE); + + /* and we prevent clutter from doing so too */ + clutter_group = clutter_get_option_group_without_init (); + + context = g_option_context_new (parameter_string); + + g_option_context_add_group (context, gtk_group); + g_option_context_add_group (context, clutter_group); + + if (entries) + g_option_context_add_main_entries (context, entries, translation_domain); + + res = g_option_context_parse (context, argc, argv, error); + g_option_context_free (context); if (!res) return CLUTTER_INIT_ERROR_GTK; @@ -679,6 +692,9 @@ gtk_clutter_init_with_args (int *argc, clutter_win32_disable_event_retrieval (); #endif /* GDK_WINDOWING_{X11,WIN32} */ + /* this is required since parsing clutter's option group did not + * complete the initialization process + */ return clutter_init_with_args (argc, argv, NULL, NULL, |