- res = gnome_vfs_url_show (real_url);
- if (res != GNOME_VFS_OK) {
- empathy_debug (DEBUG_DOMAIN, "Couldn't show URL %s: %s",
- real_url,
- gnome_vfs_result_to_string (res));
+ if (real_url) {
+ url = real_url;
+ }
+
+ /* FIXME: this does not work for multihead, we should use
+ * GdkAppLaunchContext or gtk_show_url, see bug #514396.
+ */
+ g_app_info_launch_default_for_uri (url, NULL, &error);
+ if (error) {
+ GtkWidget *dialog;
+
+ dialog = gtk_message_dialog_new (NULL, 0,
+ GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
+ _("Unable to open URI"));
+ gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
+ "%s", error->message);
+
+ g_signal_connect (dialog, "response",
+ G_CALLBACK (gtk_widget_destroy),
+ NULL);
+ gtk_window_present (GTK_WINDOW (dialog));
+
+ g_clear_error (&error);