[eog] Replace gdk_spawn_command_line_on_screen() with g_app_info_launch()
- From: Claudio Saavedra <csaavedra src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [eog] Replace gdk_spawn_command_line_on_screen() with g_app_info_launch()
- Date: Thu, 23 Dec 2010 08:17:48 +0000 (UTC)
commit ec6c2435c16a003f252afbe318b3c656d5e9de0b
Author: Claudio Saavedra <csaavedra igalia com>
Date: Thu Dec 23 00:13:09 2010 +0200
Replace gdk_spawn_command_line_on_screen() with g_app_info_launch()
This fixes the build with gtk 2.91.7
configure.ac | 2 +-
src/eog-window.c | 38 ++++++++++++++++++++++++++++++++------
2 files changed, 33 insertions(+), 7 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 094d52c..fbacee6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -83,7 +83,7 @@ GNOME_DOC_INIT
# GNOME Libs
# **********
-GTK_REQUIRED=2.91.1
+GTK_REQUIRED=2.91.7
GLIB_REQUIRED=2.25.15
GNOME_DESKTOP_REQUIRED=2.91.2
GDKPIXBUF_REQUIRED=2.4.0
diff --git a/src/eog-window.c b/src/eog-window.c
index 1eb9e3c..1d10099 100644
--- a/src/eog-window.c
+++ b/src/eog-window.c
@@ -2641,13 +2641,39 @@ static void
wallpaper_info_bar_response (GtkInfoBar *bar, gint response, EogWindow *window)
{
if (response == GTK_RESPONSE_YES) {
- GdkScreen *screen;
+ GAppInfo *app_info;
+ GError *error = NULL;
+
+ app_info = g_app_info_create_from_commandline ("gnome-appearance-properties --show-page=background",
+ "gnome-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) {
+ GdkScreen *screen;
+ GdkAppLaunchContext *context;
- screen = gtk_widget_get_screen (GTK_WIDGET (window));
- gdk_spawn_command_line_on_screen (screen,
- "gnome-appearance-properties"
- " --show-page=background",
- NULL);
+ screen = gtk_widget_get_screen (GTK_WIDGET (window));
+ context = gdk_display_get_app_launch_context (gdk_screen_get_display (screen));
+ 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 */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]