-
Notifications
You must be signed in to change notification settings - Fork 104
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
Asynchronous file dialogs #144
Comments
The default behavior of NFD seems different from other natives apps on Linux. This my app: Gravacao.de.tela.de.2025-02-27.13-15-25.webmThis is a native app: Gravacao.de.tela.de.2025-02-27.13-23-42.webmI'm having trouble to open it async like #64 and keep window always on top. I can't replicate this behavior to not lock thread and still always on top. |
I don't think you can currently do this in NFDe unfortunately. I assume you are able to keep the dialog window always on top when directly calling NFD APIs (so you must be providing NFDe with the "parent window handle"), but when you wrap the call in a |
Yes, If I directly call using NFD APIs it stay on top, but lock thread of main windows, cause this warning I showed on first video. If I call using std::async, it not show wanings, but not always on top. |
Thanks for the clarification. This seems to mean that spawning the dialog window on a separate thread will not have the "stay on top" behaviour, and so any proper solution needs to work on a single thread. This will be somewhat difficult to do properly in a cross-platform manner (but maybe not impossible), because we need to be able to yield control back to the main window, but set up a listener/callback so that we can be notified when the user selects a file. |
It is perhaps time to revisit designing an asynchronous API.
Some considerations:
Note 1: Asynchronous file dialogs are about calling an NFD API function that shows a file dialog window, but returns before the dialog is completed. It is not about multithreading or thread-safe API calls - you are still expected to call the async functions from the main thread.
Note 2: Even after this is merged, async support will be considered unstable for a while.
Related: #64
The text was updated successfully, but these errors were encountered: