/*
- Copyright (C) 2008 Christian Dywan <christian@twotoasts.de>
+ Copyright (C) 2008-2009 Christian Dywan <christian@twotoasts.de>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
#endif
+#if !GTK_CHECK_VERSION (2, 14, 0)
+
+gboolean
+gtk_show_uri (GdkScreen* screen,
+ const gchar* uri,
+ guint32 timestamp,
+ GError** error)
+{
+ g_return_val_if_fail (uri != NULL, FALSE);
+
+ return g_app_info_launch_default_for_uri (uri, NULL, NULL);
+}
+
+#endif
+
#if !GTK_CHECK_VERSION(2, 12, 0)
void
/*
- Copyright (C) 2008 Christian Dywan <christian@twotoasts.de>
+ Copyright (C) 2008-2009 Christian Dywan <christian@twotoasts.de>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
#include <config.h>
#endif
-#include <glib.h>
+#include <webkit/webkit.h>
+
+G_BEGIN_DECLS
#if !GLIB_CHECK_VERSION (2, 14, 0)
#define G_PARAM_STATIC_STRINGS \
(G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)
#endif
-#if GLIB_CHECK_VERSION (2, 16, 0)
- #include <gio/gio.h>
-#endif
-#include <webkit/webkit.h>
-
-G_BEGIN_DECLS
-
#if !GLIB_CHECK_VERSION (2, 16, 0)
gint
#endif
+#if !GTK_CHECK_VERSION (2, 14, 0)
+
+gboolean
+gtk_show_uri (GdkScreen* screen,
+ const gchar* uri,
+ guint32 timestamp,
+ GError** error);
+
+#endif
+
#if !GTK_CHECK_VERSION(2, 12, 0)
void
const gchar* uri,
gpointer user_data)
{
- gchar* command = g_strconcat ("xdg-open ", uri, NULL);
- g_spawn_command_line_async (command, NULL);
- g_free (command);
+ if (!gtk_show_uri (NULL, uri, GDK_CURRENT_TIME, NULL))
+ {
+ /* Fallback to Exo for example if GConf isn't setup */
+ gchar* command = g_strconcat ("exo-open ", uri, NULL);
+ g_spawn_command_line_async (command, NULL);
+ g_free (command);
+ }
}
static void