diff options
author | Thomas Wood <thomas.wood@intel.com> | 2010-07-12 18:07:47 +0100 |
---|---|---|
committer | Thomas Wood <thomas.wood@intel.com> | 2010-07-12 18:42:54 +0100 |
commit | 1204832568425d20a29ae16f6fe33992d8a1b3bf (patch) | |
tree | 653ebcd05caf514f1481114dc06660e74bf90867 | |
parent | 844a957ade350b1971cb49902eb0685b5098c65c (diff) | |
download | gnome-control-center-1204832568425d20a29ae16f6fe33992d8a1b3bf.tar.gz |
shell: use the correct command line argument during panel activation
Use the second argument from the argv list in the activation callback to
make sure the correct panel is loaded, since the first argument is the
application binary name.
-rw-r--r-- | shell/control-center.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/shell/control-center.c b/shell/control-center.c index 7139fda8b..5a5b1527c 100644 --- a/shell/control-center.c +++ b/shell/control-center.c @@ -29,21 +29,23 @@ #include <string.h> static void -application_prepare_action_cb (GApplication *application, GVariant *arguments, - GVariant *platform_data, GnomeControlCenter *shell) +application_prepare_action_cb (GApplication *application, + GVariant *arguments, + GVariant *platform_data, + GnomeControlCenter *shell) { - GVariantIter iter; - GVariant *temp = NULL; + gchar **argv; + gsize length; gnome_control_center_present (shell); - /* we only care about the first argv */ - g_variant_iter_init (&iter, arguments); - temp = g_variant_iter_next_value (&iter); - if (temp != NULL) + argv = g_variant_get_bytestring_array (arguments, &length); + + if (length == 2) { GError *err = NULL; - const gchar *id = g_variant_get_bytestring (temp); + const gchar *id = argv[1]; + if (!cc_shell_set_active_panel_from_id (CC_SHELL (shell), id, &err)) { if (err) |