Closed Bug 1752506 Opened 3 years ago Closed 3 years ago

[Wayland] Allow to read clipboard targets while we hold clipboard data

Categories

(Core :: Widget: Gtk, defect)

defect

Tracking

()

RESOLVED FIXED
98 Branch
Tracking Status
firefox98 --- fixed

People

(Reporter: stransky, Assigned: stransky)

References

(Blocks 2 open bugs)

Details

Crash Data

Attachments

(1 file)

Right now we don't allow to read clipboard targets unless clipboard data are already released.

Summary: [Wayland] Allows read clipboard targets while we hold clipboard data → [Wayland] Allow to read clipboard targets while we hold clipboard data

Right now we hold clipboard data in nsRetrievalContext and we don't allow any
clipboard operation until ReleaseClipboardData call.

That also lock nsRetrievalContext on Wayland untill ReleaseClipboardData call.
It may lead to clipboard failures when we're holding clipboard data but we want to read clipboard targets.

In this patch we:

  • Transfer data ownership in GetClipboardData/GetClipboardText/GetTargets and don't store the data in nsRetrievalContext.
  • On Wayland lock nsRetrievalContext only for GetClipboardData/GetClipboardText/GetTargets calls.
  • Check mClipboardRequestNumber before assert due to unreleased mClipboardData.
Assignee: nobody → stransky
Status: NEW → ASSIGNED
Pushed by stransky@redhat.com: https://hg.mozilla.org/integration/autoland/rev/08de3147621e [Linux] Don't hold clipboard data in nsRetrievalContext r=emilio
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 98 Branch
Crash Signature: [@ nsRetrievalContextWayland::GetClipboardData]
Crash Signature: [@ nsRetrievalContextWayland::GetClipboardData] → [@ nsRetrievalContextWayland::GetClipboardData] [@ nsRetrievalContextWaylandAsync::TransferAsyncClipboardData]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: