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
This commit is contained in:
Christophe Fergeau 2015-06-20 21:04:12 +02:00
parent 3f586c4a95
commit a70172cfea
2 changed files with 8 additions and 13 deletions

View file

@ -34,10 +34,6 @@
#include <clutter-gtk/clutter-gtk.h> #include <clutter-gtk/clutter-gtk.h>
#endif /* HAVE_CHEESE || HAVE_WACOM */ #endif /* HAVE_CHEESE || HAVE_WACOM */
#ifdef HAVE_CHEESE
#include <cheese-gtk.h>
#endif /* HAVE_CHEESE */
struct _CcApplicationPrivate struct _CcApplicationPrivate
{ {
CcWindow *window; CcWindow *window;
@ -131,21 +127,14 @@ cc_application_command_line (GApplication *application,
GApplicationCommandLine *command_line) GApplicationCommandLine *command_line)
{ {
CcApplication *self = CC_APPLICATION (application); CcApplication *self = CC_APPLICATION (application);
int argc;
char **argv;
GVariantDict *options; GVariantDict *options;
int retval = 0; int retval = 0;
char *search_str; char *search_str;
GStrv start_panels = NULL; GStrv start_panels = NULL;
gboolean debug; gboolean debug;
argv = g_application_command_line_get_arguments (command_line, &argc);
options = g_application_command_line_get_options_dict (command_line); 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"); debug = g_variant_dict_contains (options, "verbose");
cc_shell_log_set_debug (debug); cc_shell_log_set_debug (debug);
@ -196,8 +185,6 @@ cc_application_command_line (GApplication *application,
g_free (start_panels); g_free (start_panels);
start_panels = NULL; start_panels = NULL;
g_strfreev (argv);
return retval; return retval;
} }

View file

@ -29,6 +29,10 @@
#include <X11/Xlib.h> #include <X11/Xlib.h>
#endif #endif
#ifdef HAVE_CHEESE
#include <cheese-gtk.h>
#endif /* HAVE_CHEESE */
#include "cc-application.h" #include "cc-application.h"
int int
@ -45,6 +49,10 @@ main (int argc, char **argv)
XInitThreads (); XInitThreads ();
#endif #endif
#ifdef HAVE_CHEESE
cheese_gtk_init (&argc, &argv);
#endif /* HAVE_CHEESE */
application = cc_application_new (); application = cc_application_new ();
status = g_application_run (G_APPLICATION (application), argc, argv); status = g_application_run (G_APPLICATION (application), argc, argv);