Skip to content

cocoa: Add pasteboard URL and text/uri-list MIME type interoperation - #16541

Merged
Kontrabant merged 2 commits into
libsdl-org:mainfrom
Kontrabant:mac_text_cb
Oct 18, 2026
Merged

Kontrabant merged 2 commits into
libsdl-org:mainfrom
Kontrabant:mac_text_cb

Conversation

@Kontrabant

Copy link
Copy Markdown
Contributor

If the pasteboard exposes files as URLs, but not text/uri-list, synthesize the text/uri-list MIME type from the URLs. Likewise, when setting the clipboard data, copy the items from the text/uri-list entry to the pasteboard as URLs. This allows interoperability with cut/paste in Finder, without requiring the client to directly interact with the Cocoa API.

Fixes #16439

  • I confirm that I am the author of this code and release it to the SDL project under the zlib license. This contribution does not contain code from other sources, including code generated by a Large Language Model ("AI").

If there is no explicit text/uri-list MIME type, and the pasteboard contains URLs, synthesize the text/uri-list contents from the URLs.
Add the file URLs from text/uri-list to the pasteboard as URLs. This allows pasting file paths into Finder.
@Kontrabant
Kontrabant merged commit a5a387b into libsdl-org:main Oct 18, 2026
10 checks passed
@Kontrabant
Kontrabant deleted the mac_text_cb branch October 18, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cocoa: files copied in Finder are not exposed as text/uri-list

1 participant