From 678fffdcf497832a366b8230c30fc83794391ece Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Tue, 15 Jan 2013 01:20:29 +0200 Subject: Added the OS dependent function subsurface_launch_for_uri() Opening URI addresses from Subsurface does not work on Windows using the latest GTK bundle from the Gnome website. The reason lies in GIO and GLib and how it obtains assigned applications for protocols and MIME types. While gtk_show_uri() should be viable for both linux.c and macos.c, in windows.c ShellExecute() is used, which provides proper support for the URI calls. subsurface_launch_for_uri() returns TRUE on success. Signed-off-by: Lubomir I. Ivanov Signed-off-by: Dirk Hohndel --- macos.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'macos.c') diff --git a/macos.c b/macos.c index b8451cfd0..b67c9d6ea 100644 --- a/macos.c +++ b/macos.c @@ -220,3 +220,15 @@ gboolean subsurface_os_feature_available(os_feature_t f) { return TRUE; } + +gboolean subsurface_launch_for_uri(const char* uri) +{ + GError *err = NULL; + gtk_show_uri(NULL, uri, gtk_get_current_event_time(), &err); + if (err) { + g_message("%s: %s", err->message, uri); + g_error_free(err); + return FALSE; + } + return TRUE; +} -- cgit v1.2.3-70-g09d2