]> www.fi.muni.cz Git - evince.git/blobdiff - shell/ev-window.c
Bug 558064 – build with single includes
[evince.git] / shell / ev-window.c
index 75120ba89646189fd8facd2358d521fe01c8e935..0205bc45b5e43faae3612d31f251d5e976e27559 100644 (file)
@@ -37,7 +37,7 @@
 #include <glib/gi18n.h>
 #include <gio/gio.h>
 #include <gtk/gtk.h>
-#include <gtk/gtkprintunixdialog.h>
+#include <gtk/gtkunixprint.h>
 #include <gconf/gconf-client.h>
 
 #include "egg-editable-toolbar.h"
@@ -3053,8 +3053,6 @@ ev_window_cmd_view_presentation (GtkAction *action, EvWindow *window)
        presentation = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
        if (presentation) {
                ev_window_run_presentation (window);
-       } else {
-               ev_window_stop_presentation (window, TRUE);
        }
 }
 
@@ -4836,6 +4834,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 +4862,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);
@@ -4896,7 +4900,8 @@ launch_external_uri (EvWindow *window, EvLinkAction *action)
                                              GDK_CURRENT_TIME);
 #endif
 
-       if (!g_strstr_len (uri, strlen (uri), "://")) {
+       if (!g_strstr_len (uri, strlen (uri), "://") &&
+           !g_str_has_prefix (uri, "mailto:")) {
                gchar *http;
                
                /* Not a valid uri, assuming it's http */