[epiphany] Consistently use the default clipboard



commit d93cd8bf456dc6e3c793a64a14e628d7a459dfa7
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Sun Jul 23 09:25:53 2017 -0500

    Consistently use the default clipboard
    
    It's good to be consistent in how our menu items work. Currently the
    copy item in the history dialog sets only the cut/paste clipboard, while
    the web view context menu sets the primary selection too. GTK+ now has a
    concept of default clipboard, so let's just use that.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=785299

 lib/widgets/ephy-location-entry.c |    2 +-
 src/ephy-history-dialog.c         |    3 ++-
 src/popup-commands.c              |    4 +---
 3 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/lib/widgets/ephy-location-entry.c b/lib/widgets/ephy-location-entry.c
index 6835c3d..fe583c2 100644
--- a/lib/widgets/ephy-location-entry.c
+++ b/lib/widgets/ephy-location-entry.c
@@ -600,7 +600,7 @@ entry_paste_and_go_activate_cb (GtkMenuItem       *item,
 {
   GtkClipboard *clipboard;
 
-  clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
+  clipboard = gtk_clipboard_get_default (gdk_display_get_default ());
   gtk_clipboard_request_text (clipboard,
                               (GtkClipboardTextReceivedFunc)paste_received,
                               entry);
diff --git a/src/ephy-history-dialog.c b/src/ephy-history-dialog.c
index 269fbc7..4a1bde8 100644
--- a/src/ephy-history-dialog.c
+++ b/src/ephy-history-dialog.c
@@ -393,7 +393,8 @@ copy_url (GSimpleAction *action,
 
   if (g_list_length (selection) == 1) {
     EphyHistoryURL *url = selection->data;
-    gtk_clipboard_set_text (gtk_clipboard_get (GDK_SELECTION_CLIPBOARD), url->url, -1);
+    gtk_clipboard_set_text (gtk_clipboard_get_default (gdk_display_get_default ()),
+                            url->url, -1);
   }
 
   g_list_free_full (selection, (GDestroyNotify)ephy_history_url_free);
diff --git a/src/popup-commands.c b/src/popup-commands.c
index ad8304a..0432549 100644
--- a/src/popup-commands.c
+++ b/src/popup-commands.c
@@ -104,9 +104,7 @@ popup_cmd_media_in_new_window (GSimpleAction *action,
 static void
 popup_cmd_copy_to_clipboard (EphyWindow *window, const char *text)
 {
-  gtk_clipboard_set_text (gtk_clipboard_get (GDK_NONE),
-                          text, -1);
-  gtk_clipboard_set_text (gtk_clipboard_get (GDK_SELECTION_PRIMARY),
+  gtk_clipboard_set_text (gtk_clipboard_get_default (gdk_display_get_default ()),
                           text, -1);
 }
 


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