[balsa/wip/gtk4: 80/351] Clipboard API changed



commit c94ea17c576773d4950b244b896ee49a2f5a1d55
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Sun Dec 3 08:52:56 2017 -0500

    Clipboard API changed

 libbalsa/source-viewer.c     |    8 +++-----
 src/balsa-mime-widget-text.c |    9 +++------
 2 files changed, 6 insertions(+), 11 deletions(-)
---
diff --git a/libbalsa/source-viewer.c b/libbalsa/source-viewer.c
index 9d2f98a..132509a 100644
--- a/libbalsa/source-viewer.c
+++ b/libbalsa/source-viewer.c
@@ -60,12 +60,10 @@ lsv_copy_activated(GSimpleAction * action,
         g_object_get_data(G_OBJECT(user_data), "lsvi");
     GtkTextView *text = GTK_TEXT_VIEW(lsvi->text);
     GtkTextBuffer *buffer = gtk_text_view_get_buffer(text);
-    GdkDisplay *display;
-    GtkClipboard *clipboard;
-
-    display = gtk_widget_get_display(GTK_WIDGET(text));
-    clipboard = gtk_clipboard_get_for_display(display, GDK_SELECTION_CLIPBOARD);
+    GdkClipboard *clipboard;
+    GtkWidget *window = user_data;
 
+    clipboard = gtk_widget_get_clipboard(window);
     gtk_text_buffer_copy_clipboard(buffer, clipboard);
 }
 
diff --git a/src/balsa-mime-widget-text.c b/src/balsa-mime-widget-text.c
index cc03390..92d49ce 100644
--- a/src/balsa-mime-widget-text.c
+++ b/src/balsa-mime-widget-text.c
@@ -437,13 +437,10 @@ structured_phrases_toggle(GtkCheckMenuItem *checkmenuitem,
 static void
 url_copy_cb(GtkWidget * menu_item, message_url_t * uri)
 {
-    GdkDisplay *display;
-    GtkClipboard *clipboard;
+    GdkClipboard *clipboard;
 
-    display = gtk_widget_get_display(menu_item);
-    clipboard =
-        gtk_clipboard_get_for_display(display, GDK_SELECTION_PRIMARY);
-    gtk_clipboard_set_text(clipboard, uri->url, -1);
+    clipboard = gtk_widget_get_clipboard(menu_item);
+    gdk_clipboard_set_text(clipboard, uri->url);
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]