From a70172cfeacd1037e3b1d43431cd10b8084dbf6d Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Sat, 20 Jun 2015 21:04:12 +0200 Subject: [PATCH] shell: Move cheese_gtk_init() call earlier Now that we handle local command line arguments, the 'command_line' vfunc can no longer get the initial argc/argv passed to the process. Now, cheese_gtk_init() is called unconditionally from main() where argc/argv are available. https://bugzilla.gnome.org/show_bug.cgi?id=751597 --- shell/cc-application.c | 13 ------------- shell/main.c | 8 ++++++++ 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/shell/cc-application.c b/shell/cc-application.c index 26221ce9b..bedf4c16b 100644 --- a/shell/cc-application.c +++ b/shell/cc-application.c @@ -34,10 +34,6 @@ #include #endif /* HAVE_CHEESE || HAVE_WACOM */ -#ifdef HAVE_CHEESE -#include -#endif /* HAVE_CHEESE */ - struct _CcApplicationPrivate { CcWindow *window; @@ -131,21 +127,14 @@ cc_application_command_line (GApplication *application, GApplicationCommandLine *command_line) { CcApplication *self = CC_APPLICATION (application); - int argc; - char **argv; GVariantDict *options; int retval = 0; char *search_str; GStrv start_panels = NULL; gboolean debug; - argv = g_application_command_line_get_arguments (command_line, &argc); options = g_application_command_line_get_options_dict (command_line); -#ifdef HAVE_CHEESE - cheese_gtk_init (&argc, &argv); -#endif /* HAVE_CHEESE */ - debug = g_variant_dict_contains (options, "verbose"); cc_shell_log_set_debug (debug); @@ -196,8 +185,6 @@ cc_application_command_line (GApplication *application, g_free (start_panels); start_panels = NULL; - g_strfreev (argv); - return retval; } diff --git a/shell/main.c b/shell/main.c index 3bf139e69..957dd1f20 100644 --- a/shell/main.c +++ b/shell/main.c @@ -29,6 +29,10 @@ #include #endif +#ifdef HAVE_CHEESE +#include +#endif /* HAVE_CHEESE */ + #include "cc-application.h" int @@ -45,6 +49,10 @@ main (int argc, char **argv) XInitThreads (); #endif +#ifdef HAVE_CHEESE + cheese_gtk_init (&argc, &argv); +#endif /* HAVE_CHEESE */ + application = cc_application_new (); status = g_application_run (G_APPLICATION (application), argc, argv);