From 8cf5f1c4f4224bc8863ab498c4d89082db6ceb7b Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Thu, 23 Dec 2010 13:36:50 +0100 Subject: main-window: use g_app_info_launch() instead of gdk_spawn_on_screen() (#637854) --- src/empathy-main-window.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/empathy-main-window.c b/src/empathy-main-window.c index b1e26f5e5..e0b05531b 100644 --- a/src/empathy-main-window.c +++ b/src/empathy-main-window.c @@ -1481,9 +1481,9 @@ main_window_help_debug_cb (GtkAction *action, { GdkScreen *screen = gdk_screen_get_default (); GError *error = NULL; - gchar *argv[2] = { NULL, }; - gint i = 0; gchar *path; + GAppInfo *app_info; + GdkAppLaunchContext *context; g_return_if_fail (GDK_IS_SCREEN (screen)); @@ -1496,17 +1496,26 @@ main_window_help_debug_cb (GtkAction *action, path = g_build_filename (BIN_DIR, "empathy-debugger", NULL); } - argv[i++] = path; + app_info = g_app_info_create_from_commandline (path, NULL, 0, &error); + if (app_info == NULL) { + DEBUG ("Failed to create app info: %s", error->message); + g_error_free (error); + goto out; + } - gdk_spawn_on_screen (screen, NULL, argv, NULL, - G_SPAWN_SEARCH_PATH, - NULL, NULL, NULL, &error); + context = gdk_app_launch_context_new (); + gdk_app_launch_context_set_display (context, gdk_screen_get_display (screen)); - if (error) { + if (!g_app_info_launch (app_info, NULL, (GAppLaunchContext *) context, + &error)) { g_warning ("Failed to open debug window: %s", error->message); g_error_free (error); + goto out; } +out: + tp_clear_object (&app_info); + tp_clear_object (&context); g_free (path); } -- cgit v1.2.3