Make Litehtml's "Copy Link" menuitem actually do something
authorAndrej Kacian <ticho@claws-mail.org>
Fri, 1 Feb 2019 20:33:36 +0000 (21:33 +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 a92735a..152053d 100644 (file)
@@ -542,7 +542,12 @@ static void open_link_cb(GtkMenuItem *item, gpointer user_data)
 
 static void copy_link_cb(GtkMenuItem *item, gpointer user_data)
 {
-//     lh_widget_wrapped *w = (lh_widget_wrapped *)user_data;
+       lh_widget_wrapped *w = (lh_widget_wrapped *)user_data;
+
+       gtk_clipboard_set_text(gtk_clipboard_get(GDK_SELECTION_PRIMARY),
+                       w->m_clicked_url.c_str(), -1);
+       gtk_clipboard_set_text(gtk_clipboard_get(GDK_SELECTION_CLIPBOARD),
+                       w->m_clicked_url.c_str(), -1);
 }
 
 ///////////////////////////////////////////////////////////