use gtk_show_uri() in wxLaunchDefaultBrowser() implementation for GTK+
This commit is contained in:
@@ -36,10 +36,11 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __WXGTK__
|
#ifdef __WXGTK__
|
||||||
#include <gdk/gdk.h>
|
#include <gtk/gtk.h>
|
||||||
#ifdef GDK_WINDOWING_X11
|
#ifdef GDK_WINDOWING_X11
|
||||||
#include <gdk/gdkx.h>
|
#include <gdk/gdkx.h>
|
||||||
#endif
|
#endif
|
||||||
|
GdkWindow* wxGetTopLevelGDK();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Only X11 backend is supported for wxGTK here
|
// Only X11 backend is supported for wxGTK here
|
||||||
@@ -2609,6 +2610,19 @@ bool wxDoLaunchDefaultBrowser(const wxString& url, int flags)
|
|||||||
{
|
{
|
||||||
wxUnusedVar(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
|
// Our best best is to use xdg-open from freedesktop.org cross-desktop
|
||||||
// compatibility suite xdg-utils
|
// compatibility suite xdg-utils
|
||||||
// (see http://portland.freedesktop.org/wiki/) -- this is installed on
|
// (see http://portland.freedesktop.org/wiki/) -- this is installed on
|
||||||
|
Reference in New Issue
Block a user