diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2010-12-22 16:55:38 +0100 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2010-12-22 17:00:54 +0100 |
commit | 13b6a5a50db8dd35dbcbbf1d318ba747609dfb70 (patch) | |
tree | ab271f0dde8c113a584d3e5f493708e1e1c9f76e /eel/eel-gnome-extensions.c | |
parent | 74a8f78e2a5b06485c7daf830372a5f7b15a87b8 (diff) | |
download | nautilus-13b6a5a50db8dd35dbcbbf1d318ba747609dfb70.tar.gz |
eel: don't use gdk_spawn_ API
Diffstat (limited to 'eel/eel-gnome-extensions.c')
-rw-r--r-- | eel/eel-gnome-extensions.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/eel/eel-gnome-extensions.c b/eel/eel-gnome-extensions.c index c9f2970e2..fbe74378e 100644 --- a/eel/eel-gnome-extensions.c +++ b/eel/eel-gnome-extensions.c @@ -165,17 +165,34 @@ eel_gnome_open_terminal_on_screen (const char *command, GdkScreen *screen) { char *command_line; + GAppInfo *app; + GdkAppLaunchContext *ctx; + GError *error = NULL; - if (screen == NULL) { - screen = gdk_screen_get_default (); - } - command_line = eel_gnome_make_terminal_command (command); if (command_line == NULL) { g_message ("Could not start a terminal"); return; } - gdk_spawn_command_line_on_screen (screen, command_line, NULL); + + app = g_app_info_create_from_commandline (command_line, NULL, 0, &error); + + if (app != NULL && screen != NULL) { + ctx = gdk_app_launch_context_new (); + gdk_app_launch_context_set_screen (ctx, screen); + + g_app_info_launch (app, NULL, G_APP_LAUNCH_CONTEXT (ctx), &error); + + g_object_unref (app); + g_object_unref (ctx); + } + + if (error != NULL) { + g_message ("Could not start application on terminal: %s", error->message); + + g_error_free (error); + } + g_free (command_line); } |