From 17e6cdbb2c64db060090e57c96e18da2fd6b7873 Mon Sep 17 00:00:00 2001 From: Claudio Saavedra Date: Thu, 23 Dec 2010 00:13:09 +0200 Subject: Replace gdk_spawn_command_line_on_screen() with g_app_info_launch() origin commit: https://gitlab.gnome.org/GNOME/eog/commit/ec6c243 https://gitlab.gnome.org/GNOME/eog/commit/adc355d --- src/eom-window.c | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/src/eom-window.c b/src/eom-window.c index 2ba22d4..bb8c6d9 100644 --- a/src/eom-window.c +++ b/src/eom-window.c @@ -2668,13 +2668,39 @@ static void wallpaper_info_bar_response (GtkInfoBar *bar, gint response, EomWindow *window) { if (response == GTK_RESPONSE_YES) { - GdkScreen *screen; + GAppInfo *app_info; + GError *error = NULL; + + app_info = g_app_info_create_from_commandline ("mate-appearance-properties --show-page=background", + "mate-appearance-properties", + G_APP_INFO_CREATE_NONE, + &error); + + if (error != NULL) { + g_warning ("%s%s", _("Error launching appearance preferences dialog: "), + error->message); + g_error_free (error); + error = NULL; + } + + if (app_info != NULL) { + GdkAppLaunchContext *context; + GdkDisplay *display; - screen = gtk_widget_get_screen (GTK_WIDGET (window)); - mate_gdk_spawn_command_line_on_screen (screen, - "mate-appearance-properties" - " --show-page=background", - NULL); + display = gtk_widget_get_display (GTK_WIDGET (window)); + context = gdk_display_get_app_launch_context (display); + g_app_info_launch (app_info, NULL, G_APP_LAUNCH_CONTEXT (context), &error); + + if (error != NULL) { + g_warning ("%s%s", _("Error launching appearance preferences dialog: "), + error->message); + g_error_free (error); + error = NULL; + } + + g_object_unref (context); + g_object_unref (app_info); + } } /* Close message area on every response */ -- cgit v1.2.1