[nautilus] eel: don't use gdk_spawn_ API
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] eel: don't use gdk_spawn_ API
- Date: Wed, 22 Dec 2010 16:01:38 +0000 (UTC)
commit 13b6a5a50db8dd35dbcbbf1d318ba747609dfb70
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Wed Dec 22 16:55:38 2010 +0100
eel: don't use gdk_spawn_ API
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 c9f2970..fbe7437 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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]