Closed Bug 1698033 Opened 3 years ago Closed 3 years ago

Copy & Paste works only half the time with Wayland

Categories

(Core :: Widget: Gtk, defect)

Firefox 88
defect

Tracking

()

RESOLVED DUPLICATE of bug 1703763

People

(Reporter: mozilla, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0

Steps to reproduce:

C&P either ctrl-c or context menu

Actual results:

About half the time the clipboard content get not updated, sometimes it is cleared/emtpy, half the time it works. X11 with current Manjaro works. The same installation with Wayland not.

Expected results:

C (&P) works

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core

Do I understand correctly that you can't copy data from Firefox, right?
Which Wayland compositor do you run? Can you use wl-paste utility to confirm clipboard content. i.e. that data are really missing?
Thanks.

Blocks: wayland
Flags: needinfo?(mozilla)

We are seeing the same on openSUSE side: https://bugzilla.opensuse.org/show_bug.cgi?id=1183376
Currently, it works again for me, so I can't investigate further.

According to https://bugzilla.opensuse.org/show_bug.cgi?id=1183376 Firefox 78 is not supposed to run under Wayland as it's missing important Wayland fixes.

Can you please test with latest nightly? If you see so please run on terminal as:

MOZ_LOG="WidgetClipboard:5" firefox

and attach the log here.
Thanks.

Heads-up (as I've reported this kind of issue before): if you're using GNOME, it might also be a regression in Mutter, because I also started seeng it happen on other apps (both Gtk and Qt).

Restarting the application fixes it.

Attached file ClipboardPasteLog
I'm seeing this on Arch Linux, version 86.0.1. Both regular Firefox and Nightly. In my case it happens 100% of the time (can't paste into any other application), but doesn't cause any other crashes or failures. Emacs reports (error "Timed out waiting for reply from selection owner").

I installed and started firefox-nightly and tried from there, with MOZ_LOG set. In this case it did eventually paste into Emacs, but only after seven or eight seconds. Here's the full log:

I'm seeing this on Arch Linux, version 86.0.1. Both regular Firefox and Nightly. In my case it happens 100% of the time (can't paste into any other application), but doesn't cause any other crashes or failures. Emacs reports (error "Timed out waiting for reply from selection owner").

I installed and started firefox-nightly and tried from there, with MOZ_LOG set. In this case it did eventually paste into Emacs, but only after seven or eight seconds. Here's the full log (conversion to an attachment failed), including me quitting Firefox at the end:

[eric@slip ~]$ env MOZ_LOG="WidgetClipboard:5" /usr/bin/firefox-nightly
[Parent 51166: Main Thread]: D/WidgetClipboard data_device_data_offer(), wl_data_offer 7f22a508fd80
[Parent 51166: Main Thread]: D/WidgetClipboard nsRetrievalContextWayland::RegisterNewDataOffer (wl_data_offer) 7f22a508fd80
[Parent 51166: Main Thread]: D/WidgetClipboard data_device_selection(), set wl_data_offer 7f22a508fd80
[Parent 51166: Main Thread]: D/WidgetClipboard nsRetrievalContextWayland::SetClipboardDataOffer (wl_data_offer) 7f22a508fd80
[Parent 51166: Main Thread]: D/WidgetClipboard primary_selection_selection()
[Parent 51166: Main Thread]: D/WidgetClipboard nsRetrievalContextWayland::SetPrimaryDataOffer (primary) 0
[Parent 51166: Main Thread]: D/WidgetClipboard nsClipboard::HasDataMatchingFlavors (clipboard)
[Parent 51166: Main Thread]: D/WidgetClipboard has kUnicodeMime
[Parent 51166: Main Thread]: D/WidgetClipboard data_device_data_offer(), wl_data_offer 7f229310b420
[Parent 51166: Main Thread]: D/WidgetClipboard nsRetrievalContextWayland::RegisterNewDataOffer (wl_data_offer) 7f229310b420
[Parent 51166: Main Thread]: D/WidgetClipboard data_device_selection(), set wl_data_offer 7f229310b420
[Parent 51166: Main Thread]: D/WidgetClipboard nsRetrievalContextWayland::SetClipboardDataOffer (wl_data_offer) 7f229310b420
[Parent 51166: Main Thread]: D/WidgetClipboard primary_selection_selection()
[Parent 51166: Main Thread]: D/WidgetClipboard nsRetrievalContextWayland::SetPrimaryDataOffer (primary) 0
[Parent 51166: Main Thread]: D/WidgetClipboard nsClipboard::SetData (primary)
[Parent 51166: Main Thread]: D/WidgetClipboard text targets
[Parent 51166: Main Thread]: D/WidgetClipboard gtk_target_table_new_from_list() = 7f2294ecee80
[Parent 51166: Main Thread]: D/WidgetClipboard gtk_clipboard_set_with_data() is ok
[Parent 51166: Main Thread]: D/WidgetClipboard primary_selection_data_offer()
[Parent 51166: Main Thread]: D/WidgetClipboard nsRetrievalContextWayland::RegisterNewDataOffer (primary) 7f229310b9c0
[Parent 51166: Main Thread]: D/WidgetClipboard primary_selection_selection()
[Parent 51166: Main Thread]: D/WidgetClipboard nsRetrievalContextWayland::SetPrimaryDataOffer (primary) 7f229310b9c0
[Parent 51166: Main Thread]: D/WidgetClipboard nsClipboard::SetData (clipboard)
[Parent 51166: Main Thread]: D/WidgetClipboard text targets
[Parent 51166: Main Thread]: D/WidgetClipboard gtk_target_table_new_from_list() = 7f2294ece0c0
[Parent 51166: Main Thread]: D/WidgetClipboard gtk_clipboard_set_with_data() is ok
[Parent 51166: Main Thread]: D/WidgetClipboard data_device_data_offer(), wl_data_offer 7f228d425330
[Parent 51166: Main Thread]: D/WidgetClipboard nsRetrievalContextWayland::RegisterNewDataOffer (wl_data_offer) 7f228d425330
[Parent 51166: Main Thread]: D/WidgetClipboard data_device_selection(), set wl_data_offer 7f228d425330
[Parent 51166: Main Thread]: D/WidgetClipboard nsRetrievalContextWayland::SetClipboardDataOffer (wl_data_offer) 7f228d425330
[Parent 51166: Main Thread]: D/WidgetClipboard clipboard_get_cb() callback
[Parent 51166: Main Thread]: D/WidgetClipboard nsClipboard::SelectionGetEvent (primary)
[Parent 51166: Main Thread]: D/WidgetClipboard selection target text/plain;charset=utf-8
[Parent 51166: Main Thread]: D/WidgetClipboard providing text/unicode data
[Parent 51166: Main Thread]: D/WidgetClipboard sent 116 bytes of utf-8 data
[Parent 51166: Main Thread]: D/WidgetClipboard using gtk_selection_data_set for 'text/plain;charset=utf-8'
[Parent 51166: Main Thread]: D/WidgetClipboard clipboard_get_cb() callback
[Parent 51166: Main Thread]: D/WidgetClipboard nsClipboard::SelectionGetEvent (clipboard)
[Parent 51166: Main Thread]: D/WidgetClipboard selection target text/plain;charset=utf-8
[Parent 51166: Main Thread]: D/WidgetClipboard providing text/unicode data
[Parent 51166: Main Thread]: D/WidgetClipboard sent 116 bytes of utf-8 data
[Parent 51166: Main Thread]: D/WidgetClipboard using gtk_selection_data_set for 'text/plain;charset=utf-8'

(firefox:51166): Gdk-WARNING **: 08:40:02.849: Error writing selection data: Error writing to file descriptor: Broken pipe

(firefox:51166): Gdk-WARNING **: 08:40:02.849: Error writing selection data: Error writing to file descriptor: Broken pipe
[Parent 51166: Main Thread]: D/WidgetClipboard clipboard_get_cb() callback
[Parent 51166: Main Thread]: D/WidgetClipboard nsClipboard::SelectionGetEvent (clipboard)
[Parent 51166: Main Thread]: D/WidgetClipboard selection target COMPOUND_TEXT
[Parent 51166: Main Thread]: D/WidgetClipboard providing text/unicode data
[Parent 51166: Main Thread]: D/WidgetClipboard sent 116 bytes of utf-8 data
[Parent 51166: Main Thread]: D/WidgetClipboard data_device_data_offer(), wl_data_offer 7f228d425d30
[Parent 51166: Main Thread]: D/WidgetClipboard nsRetrievalContextWayland::RegisterNewDataOffer (wl_data_offer) 7f228d425d30
[Parent 51166: Main Thread]: D/WidgetClipboard data_device_selection(), set wl_data_offer 7f228d425d30
[Parent 51166: Main Thread]: D/WidgetClipboard nsRetrievalContextWayland::SetClipboardDataOffer (wl_data_offer) 7f228d425d30
[Parent 51166: Main Thread]: D/WidgetClipboard primary_selection_data_offer()
[Parent 51166: Main Thread]: D/WidgetClipboard nsRetrievalContextWayland::RegisterNewDataOffer (primary) 7f228d425dd0
[Parent 51166: Main Thread]: D/WidgetClipboard primary_selection_selection()
[Parent 51166: Main Thread]: D/WidgetClipboard nsRetrievalContextWayland::SetPrimaryDataOffer (primary) 7f228d425dd0
[Parent 51166: Main Thread]: D/WidgetClipboard data_device_data_offer(), wl_data_offer 7f2292b2a6f0
[Parent 51166: Main Thread]: D/WidgetClipboard nsRetrievalContextWayland::RegisterNewDataOffer (wl_data_offer) 7f2292b2a6f0
[Parent 51166: Main Thread]: D/WidgetClipboard data_device_selection(), set wl_data_offer 7f2292b2a6f0
[Parent 51166: Main Thread]: D/WidgetClipboard nsRetrievalContextWayland::SetClipboardDataOffer (wl_data_offer) 7f2292b2a6f0
[Parent 51166: Main Thread]: D/WidgetClipboard primary_selection_data_offer()
[Parent 51166: Main Thread]: D/WidgetClipboard nsRetrievalContextWayland::RegisterNewDataOffer (primary) 7f2292b2a830
[Parent 51166: Main Thread]: D/WidgetClipboard primary_selection_selection()
[Parent 51166: Main Thread]: D/WidgetClipboard nsRetrievalContextWayland::SetPrimaryDataOffer (primary) 7f2292b2a830
[2021-03-18T15:41:01Z ERROR xulstore::persist] removeDocument error: unavailable
[Parent 51166: Main Thread]: D/WidgetClipboard clipboard_clear_cb() callback
[Parent 51166: Main Thread]: D/WidgetClipboard nsClipboard::SelectionClearEvent (clipboard)
[Parent 51166: Main Thread]: D/WidgetClipboard clipboard_clear_cb() callback
[Parent 51166: Main Thread]: D/WidgetClipboard nsClipboard::SelectionClearEvent (primary)

Almost immediately after posting this, the problem seems to have gone away completely. Firefox is still at the same version, but so many things get updated on a rolling basis on Arch that I have no way of even guessing what happened, or why the problem went away. Maybe the logs above will still be of some interest to someone.

Okay, Thanks. Please reopen if you see it again.

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Flags: needinfo?(mozilla)
Resolution: --- → WORKSFORME

This happened to me just now on Ubuntu 20.10, copying from latest Nightly 89 and attempting to paste into other applications fails, requiring browser to be restarted.

Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: WORKSFORME → ---

Yup, it happens from time to time. I'm experiencing this again at this very moment.

I copied some text from a web page and can paste it anywhere inside Firefox but not outside. Attempting to paste to Wayland programs (tried gedit, Termite) does nothing. Attempting to paste to XWayland programs also does not work (tried Signal, Slack, Leafpad). Seems that Electron based XWayland programs freeze for a moment when pasting and then nothing. Running wl-paste in terminal just hangs and never finishes. wl-paste does finish with empty output if I copy something else in FF.

I'm currently using Firefox 88.0b6 in Wayland mode under the Sway compositor version 1.5.1 on Archlinux.

Having experienced this many times I can say that if I would just reboot Firefox now, copy & paste would start working again. I've also had Firefox crash when quitting Firefox while pasting to a XWayland program is still frozen.

It may be covered by Bug 1703763.

Status: REOPENED → RESOLVED
Closed: 3 years ago3 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: