File 0001-Work-around-disfunctional-gtk_show_uri-on-Windows.patch of Package mingw64-evince
From 57c866b640833738747ce9063b5a6a936a4576df Mon Sep 17 00:00:00 2001
From: Hib Eris <hib@hiberis.nl>
Date: Tue, 11 Oct 2011 10:54:47 +0200
Subject: [PATCH 01/12] Work around disfunctional gtk_show_uri() on Windows
This should realy be fixed in glib, but for now, we use this ugly hack.
---
shell/ev-window.c | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/shell/ev-window.c b/shell/ev-window.c
index 761069c..4c9e8e1 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -100,6 +100,14 @@
#include "ev-media-player-keys.h"
#endif /* ENABLE_DBUS */
+#define HELPHACK
+#ifdef HELPHACK
+#include <glib.h>
+#ifdef G_OS_WIN32
+#include <windows.h>
+#endif
+#endif
+
typedef enum {
PAGE_MODE_DOCUMENT,
PAGE_MODE_PASSWORD
@@ -4736,10 +4744,25 @@ ev_window_cmd_help_contents (GtkAction *action, EvWindow *ev_window)
{
GError *error = NULL;
+#ifdef HELPHACK
+#ifdef G_OS_WIN32
+ /* This is a ugly hack, should be fixed in glib */
+ if (!(((int)ShellExecute(NULL, "open", EV_HELP, NULL, NULL, SW_SHOWNORMAL)) > 32)) {
+ error = g_error_new_literal(0, 0, "failed to open webpage");
+ }
+#else
gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (ev_window)),
EV_HELP,
gtk_get_current_event_time (),
&error);
+#endif
+#else
+ gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (ev_window)),
+ EV_HELP,
+ gtk_get_current_event_time (),
+ &error);
+#endif
+
if (error) {
ev_window_error_message (ev_window, error,
"%s", _("There was an error displaying help"));
--
1.7.5.4