GNOME Bugzilla – Bug 781814
Applications don't receive clipboard when data source mimetype is "text/plain;charset=utf-8"
Last modified: 2017-10-26 22:52:15 UTC
I'm currently using weston and I noticed that I can't copy text from some apps into GTK windows. The problem turns out to be (I debugged it) that when the data_source sends no UTF8_STRING mimetype, the window doesn't want to paste the clipboard contents. However, when copying from GTK apps they seem to "offer" the "text/plain;charset=utf-8" format, so I think that the intended behavior is to support pasting both formats.
Created attachment 351011 [details] [review] 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.
This broke copying text from Firefox to Firefox or other applications. Copying text from epiphany, gedit, or libreoffice to firefox still works. I reported a firefox bug https://bugzilla.mozilla.org/show_bug.cgi?id=1361979 just in case.
This also breaks Chromium. I've temporarily reverted this commit on my machine.
Fixed for X in commit 546433a4b7f. Wayland needs the patch in bug #782472.
This breaks copying from non-GTK apps in Windows as well. From what I can tell, the content of text/plain;charset=utf-8 is initialized with UTF8_STRING the first time it is requested, but never updated again after that. Thus, pasting text from non-GTK apps on Windows will always return stale text.