Skip to content

[release/11.0] Restore WPF clipboard text auto conversion for managed data objects - #12125

Open
Shyam-Gupta wants to merge 5 commits into
release/11.0from
dev/shgu/bug11968_11.0
Open

Shyam-Gupta wants to merge 5 commits into
release/11.0from
dev/shgu/bug11968_11.0

Conversation

@Shyam-Gupta

@Shyam-Gupta Shyam-Gupta commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Fixes #11968

Description

Restores Windows clipboard text auto conversion for WPF after the .NET 10 migration to shared OLE code.

WPF opts into a captured native fallback for Text , UnicodeText, and OEMText , while preserving managed custom-payload identity. Plain-text availability reflects Windows’ published clipboard formats, and convenience getters remain compatible with legacy IDataObject implementations.

Requires the corresponding shared-core changes in dotnet/winforms and an updated Microsoft.Private.Winforms dependency.

Customer Impact

Applications publishing ANSI text can incorrectly receive false from Clipboard.ContainsText() or empty text from Clipboard.GetText(), breaking clipboard workflows that worked in .NET 9.

Regression

Yes. Fixes a .NET 10 regression in clipboard text conversion.

Testing

Added coverage for native text synthesis before and after flushing, disabled managed conversion, published-format availability, typed and legacy retrieval, custom-payload identity, and RTF negative controls.

Validation used the matching local shared-core package:

Risk

Moderate. Native fallback is restricted to three plain-text formats and enabled only for WPF; unrelated formats retain their existing retrieval paths, and WinForms remains opted out.

Microsoft Reviewers: Open in CodeFlow

Shyam-Gupta and others added 3 commits November 12, 2026 12:06
Preserve Windows plain-text synthesis while retaining in-process custom payloads and legacy IDataObject retrieval. Add clipboard conversion regression coverage.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 918733ee-3532-46a0-92bb-728aaa5bb200
(cherry picked from commit ff095a9)
Report wrapped typed-retrieval support and cover native typed text reads plus .NET 9-style getter forwarding.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 918733ee-3532-46a0-92bb-728aaa5bb200
(cherry picked from commit 68ce741)
Co-authored-by: Copilot <[email protected]>
Copilot-Session: e32c8108-e372-40cb-9809-70f4745be462
Implement the shared-core capability contract without adding public API, so the property no longer depends on a modern .NET default interface implementation.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: e32c8108-e372-40cb-9809-70f4745be462
@Shyam-Gupta Shyam-Gupta added Servicing-approved area-clipboard Issues related to DataObject and shared clipboard labels Nov 24, 2026
@Shyam-Gupta

Copy link
Copy Markdown
Member Author

Servicing approved over email.

@subhajitm subhajitm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-clipboard Issues related to DataObject and shared clipboard PR metadata: Label to tag PRs, to facilitate with triage Servicing-approved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants