Skip to content
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

Cocoa: Fix opening dialogs from another thread #148

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jay3d
Copy link

@jay3d jay3d commented Aug 8, 2024

This fix will prevent crashes with NSWindow when trying to open dialogs from another thread.

@btzy
Copy link
Owner

btzy commented Aug 12, 2024

Thanks for the PR! This has been raised before in #46, and I kind of think that it is the responsibility of the user to call the file dialog on the main thread. Both macOS and Linux/GTK require the dialog to be called from the main thread, and it is generally recommended to keep all UI work on the main thread. It also requires that the main thread is not blocked by anything else, so it might cause surprising behaviour for downstream consumers if that isn't the case.

If Java's threading system is really an issue for many people, maybe we could have a flag to explicitly opt into this just for the purpose of building a Java library, but otherwise I do not think we should encourage this use case.

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.

2 participants