After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 782472 - UTF8_STRING<->text/plain;charset=utf-8 translation bug between x11 and wayland clients
UTF8_STRING<->text/plain;charset=utf-8 translation bug between x11 and waylan...
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: wayland
unspecified
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
: 782453 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2017-05-10 18:50 UTC by Carlos Garnacho
Modified: 2017-10-29 18:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
xwayland: Use the right atom type for further selection requests to X11 (1.20 KB, patch)
2017-05-10 18:50 UTC, Carlos Garnacho
committed Details | Review

Description Carlos Garnacho 2017-05-10 18:50:03 UTC
Patch in bug #781814 actually exercised for the first time the translation mutter does between the UTF8_STRING atom and the text/plain;charset=utf-8 mimetype, and it uncovered a bug.

Turns out we do the first XConvertSelection call with the transformed mimetype, but set up the corresponding X11SelectionData struct with the untransformed mimetype. So all subsequent operations are possibly done on the wrong mimetype.

This broke c&p from some x11 clients to GTK+ apps. Attaching a patch.
Comment 1 Carlos Garnacho 2017-05-10 18:50:31 UTC
Created attachment 351576 [details] [review]
xwayland: Use the right atom type for further selection requests to X11

If the text/plain;charset=utf-8 to UTF8_STRING conversion kicks in, we'd
still expect the former even if we started with the latter. Store the
actual mimetype we're interfacing with on the X11 side.
Comment 2 Carlos Garnacho 2017-05-10 18:52:54 UTC
*** Bug 782453 has been marked as a duplicate of this bug. ***
Comment 3 Carlos Garnacho 2017-05-10 19:07:26 UTC
Attachment 351576 [details] pushed as 5758401 - xwayland: Use the right atom type for further selection requests to X11
Comment 4 Martin 2017-10-24 13:54:16 UTC
I see this problem in ubuntu 17.10 with wayland and gnome 3.26: copy&paste from gnome-terminal to gedit or chrome hangs. Sometimes it workssss after waiting a minute.
Message in syslog: 
gnome-terminal-[4384]: Error writing selection data: Error writing to file descriptor: Broken pipe