Make Litehtml plugin open links in configured way
authorAndrej Kacian <ticho@claws-mail.org>
Tue, 29 Jan 2019 19:12:41 +0000 (20:12 +0100)
committerAndrej Kacian <ticho@claws-mail.org>
Tue, 12 Feb 2019 18:38:10 +0000 (19:38 +0100)
src/plugins/litehtml_viewer/lh_widget.cpp

index 8db070c..2998564 100644 (file)
 #include "lh_widget_wrapped.h"
 #include "http.h"
 
+extern "C" {
+const gchar *prefs_common_get_uri_cmd(void);
+}
+
 char master_css[] = {
 #include "css.inc"
 };
@@ -459,13 +463,7 @@ static gboolean button_release_event(GtkWidget *widget, GdkEventButton *event,
         if (!w->m_clicked_url.empty())
         {
                 debug_print("Open in browser: %s\n", w->m_clicked_url.c_str());
-               gtk_show_uri(gdk_screen_get_default(),
-                            w->m_clicked_url.c_str(),
-                            GDK_CURRENT_TIME, &error);
-                if (error) {
-                    g_warning("Failed opening url(%s): %s", w->m_clicked_url, error->message);
-                    g_clear_error(&error);
-                }
+                open_uri(w->m_clicked_url.c_str(), prefs_common_get_uri_cmd());
         }
     }