+
+#if GTK_CHECK_VERSION (2, 14, 0)
+ context = G_APP_LAUNCH_CONTEXT (gdk_app_launch_context_new ());
+ gdk_app_launch_context_set_screen (GDK_APP_LAUNCH_CONTEXT (context),
+ gtk_window_get_screen (GTK_WINDOW (window)));
+ gdk_app_launch_context_set_timestamp (GDK_APP_LAUNCH_CONTEXT (context),
+ GDK_CURRENT_TIME);
+#endif
+
+ if (!g_strstr_len (uri, strlen (uri), "://")) {
+ gchar *http;
+
+ /* Not a valid uri, assuming it's http */
+ http = g_strdup_printf ("http://%s", uri);
+ ret = g_app_info_launch_default_for_uri (http, NULL, &error);
+ g_free (http);
+ } else {
+ ret = g_app_info_launch_default_for_uri (uri, NULL, &error);
+ }