Closed Bug 1812078 Opened 3 years ago Closed 2 years ago

nsIClipboardOwner isn't tracked correctly on Mac

Categories

(Core :: Widget, defect)

Unspecified
macOS
defect

Tracking

()

RESOLVED FIXED
115 Branch
Tracking Status
firefox115 --- fixed

People

(Reporter: edgar, Assigned: edgar)

References

Details

Attachments

(2 files, 2 obsolete files)

There is only one cached nsITransferable and nsIClipboardOwner in nsBaseClipboard to track the ownership of clipboard data, https://searchfox.org/mozilla-central/rev/cf3af6bb6657278880f8baf38435eeb8f2d5d86c/widget/nsBaseClipboard.h#46-47. If we support multiple clipboard type, this cache is shared between them, so setting data to one clipboard type will clear the ownership for another clipboard type, and cause nsIClipboardOwner::LosingOwnership get called.

We don't encounter this issue on Windows as it only supports one clipboard type.

And we also behave correctly on Linux as it doesn't inherit nsBaseClipboard and has separated cache for each clipboard type, https://searchfox.org/mozilla-central/rev/cf3af6bb6657278880f8baf38435eeb8f2d5d86c/widget/gtk/nsClipboard.h#139-144

Instead of using mTransferable, so that windows widget don't need to access
mTransferable which is used as cache in cocoa widget.

Blocks: 1773707
Assignee: nobody → echen
Attachment #9314028 - Attachment is obsolete: true
Attachment #9323930 - Attachment description: Bug 1812078 - Part 1: Have a generic way to initialize clipboard capabilities; → WIP: Bug 1812078 - Part 1: Have a generic way to initialize clipboard capabilities;
Attachment #9314366 - Attachment description: Bug 1812078 - Part 2: Have separated clipboard caches for each clipbaord type to track clipboard owner; → WIP: Bug 1812078 - Part 2: Have separated clipboard caches for each clipbaord type to track clipboard owner;
Attachment #9314381 - Attachment description: Bug 1812078 - Part 3: Make SelectionCache type behave more generic; → WIP: Bug 1812078 - Part 3: Make SelectionCache type behave more generic;
Attachment #9323930 - Attachment description: WIP: Bug 1812078 - Part 1: Have a generic way to initialize clipboard capabilities; → Bug 1812078 - Part 1: Have a generic way to initialize clipboard capabilities;
Attachment #9314366 - Attachment description: WIP: Bug 1812078 - Part 2: Have separated clipboard caches for each clipbaord type to track clipboard owner; → Bug 1812078 - Part 2: Have separated clipboard caches for each clipbaord type to track clipboard owner;
Attachment #9314366 - Attachment description: Bug 1812078 - Part 2: Have separated clipboard caches for each clipbaord type to track clipboard owner; → WIP: Bug 1812078 - Part 2: Have separated clipboard caches for each clipbaord type to track clipboard owner;
Attachment #9314381 - Attachment description: WIP: Bug 1812078 - Part 3: Make SelectionCache type behave more generic; → Bug 1812078 - Part 3: Make SelectionCache type behave more generic;
Attachment #9314366 - Attachment description: WIP: Bug 1812078 - Part 2: Have separated clipboard caches for each clipbaord type to track clipboard owner; → Bug 1812078 - Part 2: Have separated clipboard caches for each clipbaord type to track clipboard owner;

Comment on attachment 9323930 [details]
Bug 1812078 - Part 1: Have a generic way to initialize clipboard capabilities;

Revision D173009 was moved to bug 1834710. Setting attachment 9323930 [details] to obsolete.

Attachment #9323930 - Attachment is obsolete: true
Depends on: 1834710
Attachment #9314366 - Attachment description: Bug 1812078 - Part 2: Have separated clipboard caches for each clipbaord type to track clipboard owner; → Bug 1812078 - Part 1: Have separated clipboard caches for each clipbaord type to track clipboard owner;
Attachment #9314381 - Attachment description: Bug 1812078 - Part 3: Make SelectionCache type behave more generic; → Bug 1812078 - Part 2: Make SelectionCache type behave more generic;
Attachment #9314366 - Attachment description: Bug 1812078 - Part 1: Have separated clipboard caches for each clipbaord type to track clipboard owner; → Bug 1812078 - Part 1: Have separated clipboard caches for each clipbaord type to track clipboard owner; r?mstange
Attachment #9314381 - Attachment description: Bug 1812078 - Part 2: Make SelectionCache type behave more generic; → Bug 1812078 - Part 2: Make SelectionCache type behave more generic; r?mstange
Pushed by echen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/704dc8d1421b Part 1: Have separated clipboard caches for each clipbaord type to track clipboard owner; r=mstange https://hg.mozilla.org/integration/autoland/rev/9e25deb0b839 Part 2: Make SelectionCache type behave more generic; r=mstange
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 115 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: