-
Notifications
You must be signed in to change notification settings - Fork 93
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
Try to use portals, and fall back on GTK #112
Comments
Just to be sure I'm understanding you correctly, you want to have a check at runtime to decide whether to open a Portal or GTK dialog? |
Yes. Sorry, re-reading myself, I realize that this was pretty badly written The functions could be implemented on your side with something like this: nfdresult_t NFD::openFile(NFD::UniquePathU8 outPath) {
result = NFD::Portal::openFile(outPath)
if (result == NFD_ERROR) {
return NFD::GTK::openFile(outPath)
} else return result;
} But It'd also be fine for me if |
Thanks for the clarification. It's a nice feature to have, and I'd be happy to accept a PR for such a feature (as long as it is possible at build time to select just a single implementation). There's a different but related question, about whether it should be a hard loader error if the loader cannot find libdbus or libgtk at runtime. Your current proposal will be a hard error at load time, which I'm not sure is ideal. Preventing a hard loader error is usually achieved using dlopen() (as mentioned in mlabbe/nativefiledialog#42 and mlabbe/nativefiledialog#102), but it can probably be done more nicely on Linux by importing the functions from shared libraries as weak symbols (with |
Hey !
Portals can be quite difficult to setup for users, which make it difficult for us to use it, but the native feeling is great for those who want it
Would it be possible to add a "build option" (or idk) to compile both portals and GTK implementations, and first try to use portals, and fallback on GTK popups ?
I'd be ready to help with that
Thanks !
The text was updated successfully, but these errors were encountered: