Closed Bug 1688595 Opened 5 years ago Closed 5 years ago

Copy/paste within Firefox fails to paste

Categories

(Core :: Widget: Gtk, defect, P2)

Firefox 86
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: campbell, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Attached file clipboard.log

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

Steps to reproduce:

Start Firefox with:

MOZ_ENABLE_WAYLAND=1 
GTK_BACKEND=wayland 
QT_QPA_PLATFORM=wayland
firefox-nightly

Copy from a page or URL bar, and try to paste anywhere inside Firefox. It hangs for a moment, then returns control to the user without pasting.

  • Copy/paste within other applications works fine.

  • Pasting from FF into other applications works fine.

  • Pasting from other applications into FF works fine.

  • Dragging text selections within a text box in FF works fine.

  • my system is manjaro-latest on swaywm (wayland). GTK version 1:3.24.24-2 .

Actual results:

  • If i watch the clipboard in a separate terminal with wl-paste -w wl-paste, I can see that Copy works fine (according to wayland clipboard). But FF fails on paste.

  • Firefox reports an error to stdout on the faild paste: (firefox:220341): Gdk-WARNING **: 11:36:10.179: Error writing selection data: Error writing to file descriptor: Broken pipe

  • Attached a log generated with WAYLAND_DEBUG=1 firefox-nightly > clipboard.log in case it helps. I loaded a page, copied text, tried (and failed) to paste it into the location bar, then closed FF. The interesting part starts at 1426094,689.

Expected results:

Paste should enter the text from the clipboard.

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

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

[Parent 191584: Main Thread]: D/WidgetClipboard nsClipboard::HasDataMatchingFlavors (clipboard)
[Parent 191584: Main Thread]: D/WidgetClipboard no targes at clipboard (bad match)
[Parent 191584: Main Thread]: D/WidgetClipboard nsClipboard::HasDataMatchingFlavors (clipboard)
[Parent 191584: Main Thread]: D/WidgetClipboard no targes at clipboard (bad match)
[Parent 191584: Main Thread]: D/WidgetClipboard nsClipboard::HasDataMatchingFlavors (clipboard)
[Parent 191584: Main Thread]: D/WidgetClipboard has text/html
[Parent 191584: Main Thread]: D/WidgetClipboard nsClipboard::HasDataMatchingFlavors (clipboard)
[Parent 191584: Main Thread]: D/WidgetClipboard no targes at clipboard (bad match)
[Parent 191584: Main Thread]: D/WidgetClipboard nsClipboard::HasDataMatchingFlavors (clipboard)
[Parent 191584: Main Thread]: D/WidgetClipboard no targes at clipboard (bad match)
[Parent 191584: Main Thread]: D/WidgetClipboard nsClipboard::HasDataMatchingFlavors (clipboard)
[Parent 191584: Main Thread]: D/WidgetClipboard no targes at clipboard (bad match)
[Parent 191584: Main Thread]: D/WidgetClipboard nsClipboard::HasDataMatchingFlavors (clipboard)
[Parent 191584: Main Thread]: D/WidgetClipboard has kUnicodeMime
[Parent 191584: Main Thread]: D/WidgetClipboard nsClipboard::HasDataMatchingFlavors (clipboard)
[Parent 191584: Main Thread]: D/WidgetClipboard no targes at clipboard (bad match)
[Parent 191584: Main Thread]: D/WidgetClipboard nsClipboard::GetData (clipboard)
[Parent 191584: Main Thread]: D/WidgetClipboard Flavors which can be imported:
[Parent 191584: Main Thread]: D/WidgetClipboard text/unicode
[Parent 191584: Main Thread]: D/WidgetClipboard Getting unicode text/unicode MIME clipboard data
[Parent 191584: Main Thread]: D/WidgetClipboard nsRetrievalContextWayland::GetClipboardText [0x7f42d5988830]
[Parent 191584: Main Thread]: D/WidgetClipboard DataOffer::HasTarget() we have mime text/plain;charset=utf-8
[Parent 191584: Main Thread]: D/WidgetClipboard nsRetrievalContextWayland::GetClipboardData [0x7f42d5988830] mime text/plain;charset=utf-8
[Parent 191584: Main Thread]: D/WidgetClipboard DataOffer::GetData() mime text/plain;charset=utf-8
[1426096,480] -> wl_data_offer@4278190085.receive("text/plain;charset=utf-8", fd 153)
[Parent 191584: Main Thread]: D/WidgetClipboard failed to get unicode data
[Parent 191584: Main Thread]: D/WidgetClipboard failed to get clipboard content.

Looks like we can't read the fd 153 provided by compositor.

Blocks: wayland
Priority: -- → P2
Blocks: wayland-sway
No longer blocks: wayland

Could it be because of https://github.com/swaywm/sway/pull/5788 (part of https://github.com/swaywm/wlroots/issues/2421)?

GTK needs to be at 3.24.24. Ubuntu focal is at 3.23.20 and hirsute (next ubuntu) at 3.23.23 still. I don't know what distro and version (and sway version) the OP is at though.

The sway commit above is newer than 1.5. I compile master for myself and I've had to revert that particular commit for the time being as I'm on Ubuntu 20.04.

Just to clarify that patch breaks address bar copy/paste for me. Copy/paste from a website still works.

When you copy/paste from URL bar, you communicate with Firefox process directly.
Copy/paste from a website is similar to copy/paste from another application as web content uses separated process.

The primary selection may not be an issue here - there's zwp protocol for it.

Current version of Nightly 87.0a1 (2021-01-31) no longer has the problem. Closing this issue.

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → INVALID
Resolution: INVALID → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: