summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2017-05-03 17:08:29 -0400
committerMatthias Clasen <mclasen@redhat.com>2017-05-03 18:50:21 -0400
commit7625e40e8293aa2bf76bf2b53ce888d80cf644e2 (patch)
tree671de093ddbcc48c9182c730d71f1800bd145bd1 /gtk
parent88900814cd4e4beafedbf8f52959d87e965014f5 (diff)
downloadgtk+-7625e40e8293aa2bf76bf2b53ce888d80cf644e2.tar.gz
clipboard: Try the mimetype first
Try text/plain;charset=utf-8 first, before falling back to X11-isms like UTF8_TEXT. This makes things work on Wayland compositors that don't carry a heavy X11 legacy around. https://bugzilla.gnome.org/show_bug.cgi?id=781814
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkclipboard.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gtk/gtkclipboard.c b/gtk/gtkclipboard.c
index d65e9c724d..b671128596 100644
--- a/gtk/gtkclipboard.c
+++ b/gtk/gtkclipboard.c
@@ -1041,7 +1041,14 @@ request_text_received_func (GtkClipboard *clipboard,
*/
GdkAtom target = gtk_selection_data_get_target (selection_data);
- if (target == gdk_atom_intern_static_string ("UTF8_STRING"))
+ if (target == gdk_atom_intern_static_string ("text/plain;charset=utf-8"))
+ {
+ gtk_clipboard_request_contents (clipboard,
+ gdk_atom_intern_static_string ("UTF8_TEXT"),
+ request_text_received_func, info);
+ return;
+ }
+ else if (target == gdk_atom_intern_static_string ("UTF8_STRING"))
{
gtk_clipboard_request_contents (clipboard,
gdk_atom_intern_static_string ("COMPOUND_TEXT"),
@@ -1092,7 +1099,7 @@ gtk_clipboard_request_text (GtkClipboard *clipboard,
info->callback = callback;
info->user_data = user_data;
- gtk_clipboard_request_contents (clipboard, gdk_atom_intern_static_string ("UTF8_STRING"),
+ gtk_clipboard_request_contents (clipboard, gdk_atom_intern_static_string ("text/plain;charset=utf-8"),
request_text_received_func,
info);
}