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 782694 - Copy and paste when on wayland not working well
Copy and paste when on wayland not working well
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Backend: Wayland
3.22.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2017-05-16 14:33 UTC by Daniel Rowe
Modified: 2018-05-02 18:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Copied unicode characters are decoded (158.55 KB, image/png)
2017-05-19 11:09 UTC, Anass Ahmed
Details

Description Daniel Rowe 2017-05-16 14:33:42 UTC
Copy and paste when on wayland and Gnome stops working some of the time. 

I have noticed this when copying text out of gedit and into other apps. It works then it stops, i.e. you copy a block of text and try a paste it into a different app and the buffer is empty, nothing copies. Save, exit gedit reopen and it works again for a while. I have noticed it doing this with gedit to firefox and gedit to LibreOffice Writer. When this happens and I tey and paste into LibreOffice Writer, writer just get a busy spinner but not text is copied. 

Maybe issue with wayland native app to X11 app? As when this happens I can still copy and paste in gedit itself and another gedit window.

When this happens and I try and paste into LibreOffice Writer, writer just get a busy spinner but not text is copied.

This is in the logs when it happens.

gedit[2089]: Error writing selection data: Error writing to file descriptor: Broken pipe

I raised this bug with the Fedora.

https://bugzilla.redhat.com/show_bug.cgi?id=1413858
Comment 1 jamesrstocker@gmail.com 2017-05-16 14:52:49 UTC
I can confirm this issue on wayland, I can copy text from gnome terminal and I'm not able to paste it in to gedit sometimes. However I use CopyQ clipboard manager, and the text can appear there, but cannot be pasted out. I am sometimes able to overcome this issue by changing the item that CopyQ will paste out then switch back to the old thing (i.e. switch to item 2 in the clipboard list, then back to #1) and the old thing will be pasted out as expected.

This issue can be massively transient, as I haven't noticed it for weeks, then yesterday it got me twice...
Comment 2 Pavlo Rudyi 2017-05-16 16:58:36 UTC
I have the same situation on GNOME 3.24, libwayland 1.13.0.
Comment 3 Anass Ahmed 2017-05-16 21:40:57 UTC
I've this issue too. I reported on the downstream bug (Fedora).

Happens with Gedit, LibreOffice (GTK3), Geary, and other bunch of software.

I use GPaste (I disabled it for sometime, but the problem still persisted). I had to do the same as Comment 1 to activate the item that I need to paste.
Comment 4 wpoely86 2017-05-17 07:42:16 UTC
I'm hitting the same issue. Directly copying between gnome-terminal and lets say Firefox does not work. Copying first to gedit and from there to firefox does work...
Comment 5 Pavlo Rudyi 2017-05-17 10:50:23 UTC
Guess the problem is only with between apps running in X <-> Wayland. 

Gpaste can't solve this issue.
Comment 6 Olivier Fourdan 2017-05-17 14:34:50 UTC
Looks like a regression, it stopped working for me after an update on F25
Comment 7 Olivier Fourdan 2017-05-17 14:39:35 UTC
I don't see anything in gtk/gdk that landed recently, could be related to bug 782472 in mutter though.
Comment 8 Olivier Fourdan 2017-05-17 14:49:03 UTC
Yeap, I reckon it's a mutter bug, dupe of bug 782472 - I just tried with mutter from current gnome-3-22 and copy/paste works fine there whereas I can reproduce at will without that fix.

Any chance you can try with an up-to-date mutter build (wither from gnome-3-22 or gnome-3-24 branch in git) and confirm it works in your case as well? Otherwise, I'll close this bug as a dupe of bug 782472 as I am pretty sure it's the same...
Comment 9 Pavlo Rudyi 2017-05-18 18:35:31 UTC
https://koji.fedoraproject.org/koji/buildinfo?buildID=894640

* Thu May 18 2017 Florian Müllner <fmuellner@redhat.com> - 3.25.1-2 - Fix copy+paste of UTF8 strings between X11 and wayland

Test build, not yet available in repos.
Comment 10 Anass Ahmed 2017-05-19 09:38:56 UTC
Tried to install the build in Koji as per Comment 9 and I found that:
$ sudo dnf upgrade --enablerepo=updates-testing mutter*
Error: package gnome-shell-3.22.3-1.fc25.x86_64 requires libmutter-clutter-1.0.so()(64bit), but none of the providers can be installed
Comment 12 Daniel Rowe 2017-05-19 10:58:57 UTC
The new version of Mutter has fix the issue for me.
Comment 13 Anass Ahmed 2017-05-19 11:09:38 UTC
Created attachment 352151 [details]
Copied unicode characters are decoded

I've tried the last update, still gets the error: Broken pipe, but also the copied text which is UTF-8 Arabic text is decoded as you can see in the attached image.
Comment 14 Daniel Rowe 2017-05-19 11:24:59 UTC
I only tried it with plan text.
Comment 15 Daniel Rowe 2017-05-24 10:30:40 UTC
So after a few more days using it not totally fixed. It is better, it not broken all the time.

But its still does not work all the time.
Comment 16 Pavlo Rudyi 2017-05-24 17:31:03 UTC
Sometimes I must use the copy twice in Firefox. That's all about it.
Comment 17 Daniel Rowe 2017-05-30 00:10:19 UTC
ay 29 20:17:03 vulcan.fathom13.com gnome-terminal-[1959]: gdkselection-wayland.c:266: error reading selection buffer: Operation was cancelled
May 29 20:17:06 vulcan.fathom13.com gedit[6510]: Error writing selection data: Error writing to file descriptor: Broken pipe
May 29 20:17:13 vulcan.fathom13.com gnome-shell[1524]: Failed to open pipe: Too many open files
<Lots More of the Failed to open pipe>
May 29 20:17:17 vulcan.fathom13.com gnome-shell[1524]: Failed to open pipe: Too many open files
May 29 20:17:17 vulcan.fathom13.com gnome-shell[1524]: Failed to open pipe: Too many open files
May 29 20:17:17 vulcan.fathom13.com gnome-shell[1524]: Failed to open pipe: Too many open files
May 29 20:17:23 vulcan.fathom13.com gnome-terminal-[1959]: gdkselection-wayland.c:266: error reading selection buffer: Operation was cancelled
Comment 18 Pranav Kant 2017-07-29 04:01:42 UTC
I encountered this bug as well. I am not able to paste into gnome-terminal from any other application using Ctrl + Alt + V. Interestingly, the paste -sometimes- work with a huge delay (~2 minutes or so). If I copy from the terminal and paste into the terminal (whether same tab or different tab or different terminal window), it works fine (with no delay). Copy/paste between other applications works as well. Copying from terminal and pasting to other applications works fine also. Only case not working is copying from other apps to gnome-terminal. On journal, I can find errors like this:

gnome-terminal-[3839]: gdkselection-wayland.c:266: error reading selection buffer: Operation was cancelled
Comment 19 Stefan Agner 2017-08-24 23:12:03 UTC
Very similar behaviour here, coping from Gnome Terminal and trying to paste in a form in Chromium leads to Chromium tab freeze. Going via gedit usually helps. journalctl repeats the message below every 2-10s (increasing delay). After about 60 minute (~7 messages) the issue hang disappears but the text does not end up in the Chromium form...

gnome-terminal-[3659]: Error writing selection data: Error writing to file descriptor: Broken pipe

Arch Linux, Gnome Shell 3.24.3-1.
Comment 20 Daniel Rowe 2017-09-09 12:01:57 UTC
So on Fedora 26 running on Wayland is just about completely broken.

Fails to copy and paste:

Sep 09 19:45:02 vulcan.fathom13.com gedit[10256]: Error writing selection data: Error writing to file descriptor: Broken pipe
Sep 09 19:45:02 vulcan.fathom13.com gedit[10256]: Error writing selection data: Error writing to file descriptor: Broken pipe
Sep 09 19:45:02 vulcan.fathom13.com gedit[10256]: Error writing selection data: Error writing to file descriptor: Broken pipe
Sep 09 19:45:02 vulcan.fathom13.com gedit[10256]: Error writing selection data: Error writing to file descriptor: Broken pipe
Sep 09 19:45:02 vulcan.fathom13.com gedit[10256]: Error writing selection data: Error writing to file descriptor: Broken pipe

I quite like gedit but it now unusable on Wayland.

Seems to get it self in a twist doing a bit of pasting and cutting.
Comment 21 Pavlo Rudyi 2017-09-09 16:04:47 UTC
I don't know which dark magic use the SUSE team, but after my migration from Fedora 26 I never meet this issue again.

SUSE Tumbleweed, libwayland 1.13.0, Gedit 3.22.1, GNOME 3.24.
Comment 22 kxra 2018-01-31 05:07:26 UTC
I am on Fedora 27 but have had this issue for over a year now. This bug is immensely frustrating. I am often unable to copy or cut anything out of GEdit into *any* other application. Whether that be Firefox, Epiphany, LibreOffice, Gnote, or anything else, they all just lag for a while and nothing gets pasted. Having gpaste enabled or disabled doesn't help.
Comment 23 Daniel Rowe 2018-02-03 03:12:53 UTC
I am also still seeing this bug and it make gedit not usable really on wayland.

Feb 03 11:10:27 vulcan.fathom13.com gedit[7043]: Error writing selection data: Error writing to file descriptor: Broken pipe
Feb 03 11:10:33 vulcan.fathom13.com gedit[7043]: Error writing selection data: Error writing to file descriptor: Broken pipe
Feb 03 11:10:34 vulcan.fathom13.com gnome-terminal-[2427]: gdkselection-wayland.c:267: error reading selection buffer: Operation was cancelled
Feb 03 11:10:35 vulcan.fathom13.com gedit[7043]: Error writing selection data: Error writing to file descriptor: Broken pipe

Its a basic function and its broken.
Comment 24 Olivier Fourdan 2018-02-07 08:46:24 UTC
When this happens in gedit, if you right click, do you have the “Paste” entry greyed out or available in the context menu?

And when ctrl-c/ctrl-v fails, does primary selection works though (middle click button)?

I'm trying to copy/paste various UTF8 text (from http://kermitproject.org/utf8.html) from Firefox (using Wayland native version), from chrome (X11/Xwayland) and from gnome-terminal (Wayland native gtk3) to gedit and it works fine, so there must be something else coming into play there...
Comment 25 Alexander Mayorov 2018-02-07 12:25:27 UTC
This is a sporadic issue but happens quite often.
In my case the issue is about copying from GEdit to other applications. In this case "Paste" is not grayed out from context menu (after mouse right click or Shift-F10) but nothing happens nor after Ctrl-V neither after click on "Paste" in context menu of destination window. Insertion keeps working well within GEdit windows and GEdit tabs all the time.

Every time in case of issue an error message logged:
gedit[9433]: Error writing selection data: Error writing to file descriptor: Broken pipe

I tested primary selection, e.g.:
1. Selected a part of a text in GEdit;
2. Middle click in a destination window;
3. Nothing inserted;
4. Select another part of text in GEdit;
5. The newly selected text appears in the destination window (without new click);
The described scenario may occur from time to time, may nothing insert at all or work as expected. I cannot find an event triggering issue.
Comment 26 Daniel Rowe 2018-02-07 12:40:01 UTC
So my use case is I use Fedora as my main development machine, the other day I was writing a bash script in gedit and when I tried to cut and paste into a gnome shell, it just was not working at all and spewing the broken pipe errors in the logs. Even restarting gedit and the terminal didn't help.

You are right something must trigger the behaviour, as I just opened gedit up and have just cut and paste quite a bit just now and it all working as expected. Using both ctrl-c/ctrl-v and primary selection.

So when it happens Ill report back as to if the primary selection still works of not for sure, but from memory it all stops working. I use primary selection quite a bit.
Comment 27 Olivier Fourdan 2018-02-09 08:40:59 UTC
Copy/paste has been issue #1 (literally!) after gitlab migration:

mutter: https://gitlab.gnome.org/GNOME/mutter/issues/1
gtk+: https://gitlab.gnome.org/GNOME/gtk/issues/1

And Carlos has posted fixes there. Could you try with those patches applied?
Comment 28 GNOME Infrastructure Team 2018-05-02 18:30:03 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/820.