[Xfce4-commits] [apps/xfce4-taskmanager] 07/15: gdk_spawn_command_line_on_screen() was removed, try to use g_app_info_launch()

noreply at xfce.org noreply at xfce.org
Mon Dec 8 23:02:06 CET 2014


This is an automated email from the git hooks/post-receive script.

landry pushed a commit to branch landry/gtk3
in repository apps/xfce4-taskmanager.

commit af176e4f878f730d19a511ae886524b71e827778
Author: Landry Breuil <landry at xfce.org>
Date:   Mon Dec 8 22:39:09 2014 +0100

    gdk_spawn_command_line_on_screen() was removed, try to use g_app_info_launch()
---
 src/exec-tool-button.c |   18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/src/exec-tool-button.c b/src/exec-tool-button.c
index fbb4d16..1ef6dfb 100644
--- a/src/exec-tool-button.c
+++ b/src/exec-tool-button.c
@@ -79,8 +79,24 @@ static void
 execute_command (const gchar *command)
 {
 	GError *error = NULL;
-
+#ifdef HAVE_GTK3
+	GdkScreen *screen;
+	GdkDisplay *display;
+	GdkAppLaunchContext *launch_context;
+	GAppInfo *app_info;
+	app_info = g_app_info_create_from_commandline (command, NULL, G_APP_INFO_CREATE_NONE, &error);
+	if (!error) {
+		display = gdk_screen_get_display (screen);
+		launch_context = gdk_display_get_app_launch_context (display);
+		gdk_app_launch_context_set_screen (launch_context, screen);
+		g_app_info_launch (app_info, NULL, G_APP_LAUNCH_CONTEXT
+			(launch_context), &error);
+		g_object_unref (launch_context);
+	}
+	g_object_unref (app_info);
+#else
 	gdk_spawn_command_line_on_screen (gdk_screen_get_default (), command, &error);
+#endif
 	if (error != NULL)
 	{
 		GtkWidget *dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list