Closed Bug 1726360 Opened 4 years ago Closed 4 years ago

[Wayland] Async clipboard slow paste

Categories

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

Firefox 93
defect

Tracking

()

RESOLVED FIXED
93 Branch
Tracking Status
firefox93 --- fixed

People

(Reporter: grayshade, Assigned: stransky)

References

(Blocks 1 open bug)

Details

Attachments

(6 files)

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

Steps to reproduce:

Enable widget.wayland.async-clipboard.enabled, copy some text to clipboard, paste in Firefox.

Actual results:

Paste takes about 500 ms.

Expected results:

Paste is instantaneous.

Actually, async paste seems pretty counter-intuitive, and I assume it only gets worse for images.

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

Oh, there's even a sleep call in there.

Attached file Clipboard log
Blocks: 1725149
Blocks: wayland
Priority: -- → P3
Assignee: nobody → stransky
  • Set kClipboardTimeout to 1 sec to allow image pastes.
  • Add kClipboardFastIterationNum to control how many event loop iterations will be done without sleep.

Depends on D123608

  • Allow async data transfer when widget.wayland.async-data-transfer.enabled static is set.
  • Return early when fast track request number does not match and don't process such events.
  • Use kClipboardFastIterationNum to process fast iterations.

Depends on D123609

  • Return early when mClipboardRequestNumber does not match and we're getting old data.
  • Implement kClipboardFastIterationNum to allow fast unthrottled iterations.

Depends on D123610

  • Expand NS_DND_TIMEOUT to 1 sec.
  • Do first event loop iteration without timeout.

Depends on D123611

No longer blocks: 1725149
Depends on: 1725149
Pushed by stransky@redhat.com: https://hg.mozilla.org/integration/autoland/rev/252a8a030a49 [Wayland] Add widget.wayland.async-data-transfer.enabled static pref, r=jhorak https://hg.mozilla.org/integration/autoland/rev/8b0f13706131 [Wayland] Update clipboard timeouts, r=jhorak https://hg.mozilla.org/integration/autoland/rev/f1a23246cda9 [Wayland] Sync clipboard update, r=jhorak https://hg.mozilla.org/integration/autoland/rev/f6a2a6120840 [Wayland] Async clipboard update, r=jhorak https://hg.mozilla.org/integration/autoland/rev/8dbac57c6d97 [Wayland] D&D timeouts update, r=jhorak
Flags: needinfo?(stransky)
Pushed by stransky@redhat.com: https://hg.mozilla.org/integration/autoland/rev/0dd11cc27215 [Wayland] Add widget.wayland.async-data-transfer.enabled static pref, r=jhorak https://hg.mozilla.org/integration/autoland/rev/e01edd28ebcb [Wayland] Update clipboard timeouts, r=jhorak https://hg.mozilla.org/integration/autoland/rev/0f4651d60548 [Wayland] Sync clipboard update, r=jhorak https://hg.mozilla.org/integration/autoland/rev/de30a0b31900 [Wayland] Async clipboard update, r=jhorak https://hg.mozilla.org/integration/autoland/rev/84f73e40400b [Wayland] D&D timeouts update, r=jhorak

I just tested this. With widget.wayland.async-data-transfer.enabled disabled, paste works well.

With it enabled, it's sometimes as slow as before (generally after startup), but generally fast enough that I can't paste in the address bar, press Enter and see the browser load the previous page as it used to happen before this fix.

We're moving to async clipboard by default (Bug 1729423).
widget.wayland.async-data-transfer.enabled is used by old (sync) clipboard just for data transfers so it should nor have any effect here.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: