Skip to content

Commit

Permalink
Replace gdk_spawn_command_line_on_screen()
Browse files Browse the repository at this point in the history
  • Loading branch information
csaavedra authored and raveit65 committed Jul 11, 2018
1 parent 7dbd1b8 commit 17e6cdb
Showing 1 changed file with 32 additions and 6 deletions.
38 changes: 32 additions & 6 deletions src/eom-window.c
Expand Up @@ -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 */
Expand Down

0 comments on commit 17e6cdb

Please sign in to comment.