diff --git a/src/unix/utilsx11.cpp b/src/unix/utilsx11.cpp index cb949f1054..d4502741b1 100644 --- a/src/unix/utilsx11.cpp +++ b/src/unix/utilsx11.cpp @@ -36,10 +36,11 @@ #endif #ifdef __WXGTK__ -#include +#include #ifdef GDK_WINDOWING_X11 #include #endif +GdkWindow* wxGetTopLevelGDK(); #endif // Only X11 backend is supported for wxGTK here @@ -2609,6 +2610,19 @@ bool wxDoLaunchDefaultBrowser(const wxString& url, int flags) { wxUnusedVar(flags); +#ifdef __WXGTK__ +#if GTK_CHECK_VERSION(2,14,0) +#ifndef __WXGTK3__ + if (gtk_check_version(2,14,0) == NULL) +#endif + { + GdkScreen* screen = gdk_window_get_screen(wxGetTopLevelGDK()); + if (gtk_show_uri(screen, url.utf8_str(), GDK_CURRENT_TIME, NULL)) + return true; + } +#endif // GTK_CHECK_VERSION(2,14,0) +#endif // __WXGTK__ + // Our best best is to use xdg-open from freedesktop.org cross-desktop // compatibility suite xdg-utils // (see http://portland.freedesktop.org/wiki/) -- this is installed on