]> www.fi.muni.cz Git - evince.git/commitdiff
Use GdkAppLaunchContext when available to launch external applications.
authorCarlos Garcia Campos <carlosgc@gnome.org>
Sat, 4 Oct 2008 17:20:34 +0000 (17:20 +0000)
committerCarlos Garcia Campos <carlosgc@src.gnome.org>
Sat, 4 Oct 2008 17:20:34 +0000 (17:20 +0000)
2008-10-04  Carlos Garcia Campos  <carlosgc@gnome.org>

* shell/ev-window.c: (launch_action):

Use GdkAppLaunchContext when available to launch external
applications.

svn path=/trunk/; revision=3214

ChangeLog
shell/ev-window.c

index 76bbcb7f25212690d62686e09d218753a4a828ec..195fb8c8c0c17ad114d47018ec6d74c170ede70a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-10-04  Carlos Garcia Campos  <carlosgc@gnome.org>
+
+       * shell/ev-window.c: (launch_action):
+
+       Use GdkAppLaunchContext when available to launch external
+       applications.
+       
 2008-10-04  Carlos Garcia Campos  <carlosgc@gnome.org>
 
        * shell/ev-window.c: (launch_action):
index 75120ba89646189fd8facd2358d521fe01c8e935..44a68c66f4d68b7067905b81d97684a470362658 100644 (file)
@@ -4836,6 +4836,7 @@ launch_action (EvWindow *window, EvLinkAction *action)
        GAppInfo *app_info;
        GFile *file;
        GList file_list = {NULL};
+       GAppLaunchContext *context = NULL;
        GError *error = NULL;
 
        if (filename == NULL)
@@ -4863,11 +4864,16 @@ launch_action (EvWindow *window, EvLinkAction *action)
 
                return;
        }
+
+#if GTK_CHECK_VERSION (2, 14, 0)
+       context = G_APP_LAUNCH_CONTEXT (gdk_app_launch_context_new ());
+       gdk_app_launch_context_set_screen (GDK_APP_LAUNCH_CONTEXT (context),
+                                          gtk_window_get_screen (GTK_WINDOW (window)));
+       gdk_app_launch_context_set_timestamp (GDK_APP_LAUNCH_CONTEXT (context), GDK_CURRENT_TIME);
+#endif
        
        file_list.data = file;
-
-       /* FIXME: should we use a GAppLaunchContext? */
-       if (!g_app_info_launch (app_info, &file_list, NULL, &error)) {
+       if (!g_app_info_launch (app_info, &file_list, context, &error)) {
                /* FIXME: use ev_window_error_message */
                g_warning ("%s", error->message);
                g_error_free (error);