-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[macOS, sandbox] Implement optional native file selection dialog support for sandboxed apps. #47499
Conversation
99ef60b
to
d8abca9
Compare
812af04
to
38d5173
Compare
25ec9e7
to
6b75946
Compare
ec78dd4
to
2cce949
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good to me overall, but let's keep it for 4.1 since we're now at RC.
My main concern with this PR is not specific to the changes here, but more to my ever growing feeling that we have too many single-platform-specific APIs in OS/DisplayServer which make these abstract APIs harder to parse IMO.
I'd like a system where we can easily add platform-specific features to platform singletons (MacOS
, Android
, etc.) so we don't have to make all these behaviors virtual in the abstract class, to implement them only on one platform. But that's outside the scope of this PR completely, and so far it's almost mostly my personal pet peeve, not necessarily a widespread consensus that this is how we should do this.
@bruvzg This needs a rebase and addressing Remi's documentation notes, please 🙏 |
Thanks! |
Alternative to #47056, implements godotengine/godot-proposals#1123 on macOS.
Adds ability to access arbitrary folders for macOS sandboxed apps (
Entitlements
→App Sandbox
→Enabled
is selected during export).files.user-selected
entitlement support to the export dialog.OS.is_sandboxed()
to detect running in the macOS sandbox.DisplayServer.file_dialog_show()
to display native file selection dialog. Which also saves security-scoped bookmarks for selected files/folders, to automatically gain access in the next session.FileDialog.use_native_dialog
property to seamlessly integrate native dialog to existing apps, disabled by default, used automatically when sandboxed app is accessing file system.OS_OSX::get_granted_permissions()
to get list of accessible folders/files.OS.revoke_granted_permissions()
to clear list of accessible folders/files.