|
|
e712f1c |
From 2dd407609b8987634180c045e9a6d131db6f947e Mon Sep 17 00:00:00 2001
|
|
|
e712f1c |
From: Paul Cornett <paulcor@users.noreply.github.com>
|
|
|
e712f1c |
Date: Mon, 17 Aug 2015 21:54:41 -0700
|
|
|
e712f1c |
Subject: [PATCH] use gtk_show_uri() in wxLaunchDefaultBrowser() implementation
|
|
|
e712f1c |
for GTK+
|
|
|
e712f1c |
|
|
|
e712f1c |
(cherry picked from commit 22eec388068044b9ea3c9fd1539d6686574a32df)
|
|
|
e712f1c |
---
|
|
|
e712f1c |
src/unix/utilsx11.cpp | 16 +++++++++++++++-
|
|
|
e712f1c |
1 file changed, 15 insertions(+), 1 deletion(-)
|
|
|
e712f1c |
|
|
|
e712f1c |
diff --git a/src/unix/utilsx11.cpp b/src/unix/utilsx11.cpp
|
|
|
e712f1c |
index 12ff73e..7d5811a 100644
|
|
|
e712f1c |
--- a/src/unix/utilsx11.cpp
|
|
|
e712f1c |
+++ b/src/unix/utilsx11.cpp
|
|
|
e712f1c |
@@ -36,10 +36,11 @@
|
|
|
e712f1c |
#endif
|
|
|
e712f1c |
|
|
|
e712f1c |
#ifdef __WXGTK__
|
|
|
e712f1c |
-#include <gdk/gdk.h>
|
|
|
e712f1c |
+#include <gtk/gtk.h>
|
|
|
e712f1c |
#ifdef GDK_WINDOWING_X11
|
|
|
e712f1c |
#include <gdk/gdkx.h>
|
|
|
e712f1c |
#endif
|
|
|
e712f1c |
+GdkWindow* wxGetTopLevelGDK();
|
|
|
e712f1c |
#endif
|
|
|
e712f1c |
|
|
|
e712f1c |
// Only X11 backend is supported for wxGTK here
|
|
|
e712f1c |
@@ -887,6 +888,19 @@ bool wxDoLaunchDefaultBrowser(const wxString& url, int flags)
|
|
|
e712f1c |
{
|
|
|
e712f1c |
wxUnusedVar(flags);
|
|
|
e712f1c |
|
|
|
e712f1c |
+#ifdef __WXGTK__
|
|
|
e712f1c |
+#if GTK_CHECK_VERSION(2,14,0)
|
|
|
e712f1c |
+#ifndef __WXGTK3__
|
|
|
e712f1c |
+ if (gtk_check_version(2,14,0) == NULL)
|
|
|
e712f1c |
+#endif
|
|
|
e712f1c |
+ {
|
|
|
e712f1c |
+ GdkScreen* screen = gdk_window_get_screen(wxGetTopLevelGDK());
|
|
|
e712f1c |
+ if (gtk_show_uri(screen, url.utf8_str(), GDK_CURRENT_TIME, NULL))
|
|
|
e712f1c |
+ return true;
|
|
|
e712f1c |
+ }
|
|
|
e712f1c |
+#endif // GTK_CHECK_VERSION(2,14,0)
|
|
|
e712f1c |
+#endif // __WXGTK__
|
|
|
e712f1c |
+
|
|
|
e712f1c |
// Our best best is to use xdg-open from freedesktop.org cross-desktop
|
|
|
e712f1c |
// compatibility suite xdg-utils
|
|
|
e712f1c |
// (see http://portland.freedesktop.org/wiki/) -- this is installed on
|