Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
My context: I use
rfdin my file manager Cmdr, viatauri-plugin-dialog. Thanks for your work!Problem: Since #328 (0.18.0), a save dialog with filters panics on macOS 10.15, with:
What I've worked out is that
UTTypeandNSSavePanel.allowedContentTypesare macOS 11+, andrfddoesn't state a macOS minimum. 0.17 worked fine on 10.15 Catalina (it usedallowedFileTypeseverywhere), so I think this counts as a regression. Open dialogs still useallowedFileTypes, so only the save panel is affected.My solution: With the PR,
set_allowed_typeschecksavailable!(macos = 11.0), and on 11+, it setsallowedContentTypesexactly as before, while on 10.15 it sets the extensions throughallowedFileTypes. The format picker's options keep theirFilterand go through the same function. For arm64 (or any deployment target of 11+),available!is a constanttrue, so nothing changes there.One caveat:
objc2-uniform-type-identifierslinksUniformTypeIdentifiers.frameworkhard, and dyld refuses to start an app that loads a missing framework. So an app targeting 10.15 also has to weak-link it (-C link-arg=-Wl,-weak_framework,UniformTypeIdentifiers). That's the consumer's call to do, so I've only mentioned it in the changelog.I've tested it on a real 10.15.8 Mac (Intel) with a tiny binary that opens a save dialog with two filters, weak-linked as above: 0.18.0 panics, this branch shows the dialog. Open dialogs with filters work on both. So looks like this is a win.
cargo build,test,clippy, andfmt --checkpass on macOS (aarch64 and x86_64).