Skip to content

Commit 17e6cdb

Browse files
csaavedraraveit65
authored andcommitted
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
1 parent 7dbd1b8 commit 17e6cdb

File tree

1 file changed

+32
-6
lines changed

1 file changed

+32
-6
lines changed

src/eom-window.c

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2668,13 +2668,39 @@ static void
26682668
wallpaper_info_bar_response (GtkInfoBar *bar, gint response, EomWindow *window)
26692669
{
26702670
if (response == GTK_RESPONSE_YES) {
2671-
GdkScreen *screen;
2671+
GAppInfo *app_info;
2672+
GError *error = NULL;
2673+
2674+
app_info = g_app_info_create_from_commandline ("mate-appearance-properties --show-page=background",
2675+
"mate-appearance-properties",
2676+
G_APP_INFO_CREATE_NONE,
2677+
&error);
2678+
2679+
if (error != NULL) {
2680+
g_warning ("%s%s", _("Error launching appearance preferences dialog: "),
2681+
error->message);
2682+
g_error_free (error);
2683+
error = NULL;
2684+
}
2685+
2686+
if (app_info != NULL) {
2687+
GdkAppLaunchContext *context;
2688+
GdkDisplay *display;
26722689

2673-
screen = gtk_widget_get_screen (GTK_WIDGET (window));
2674-
mate_gdk_spawn_command_line_on_screen (screen,
2675-
"mate-appearance-properties"
2676-
" --show-page=background",
2677-
NULL);
2690+
display = gtk_widget_get_display (GTK_WIDGET (window));
2691+
context = gdk_display_get_app_launch_context (display);
2692+
g_app_info_launch (app_info, NULL, G_APP_LAUNCH_CONTEXT (context), &error);
2693+
2694+
if (error != NULL) {
2695+
g_warning ("%s%s", _("Error launching appearance preferences dialog: "),
2696+
error->message);
2697+
g_error_free (error);
2698+
error = NULL;
2699+
}
2700+
2701+
g_object_unref (context);
2702+
g_object_unref (app_info);
2703+
}
26782704
}
26792705

26802706
/* Close message area on every response */

0 commit comments

Comments
 (0)