Comments (3)
Yeah, I think this is an issue on both Windows and Linux. I didn't implement this because all the known solutions to determine the parent window are guesswork if NFD isn't given a handle to the main window (e.g. the find_main_window solution you've linked), but yet it would be quite simple for the caller to get the correct window handle and tell NFD about it (assuming the proper API is added to NFD).
The main concern with having the window handle passed explicitly is that it is platform-specific, which means that we need separate platform-specific APIs on each platform NFD supports. But even though it's a bit difficult to use, I think this is the more proper solution and should be preferred to the guesswork you're proposing. Since most users of NFD use a windowing library like SDL2 or GLFW, we could potentially add a way to accept a SDL2 or GLFW window handle (in a separate header, so the NFD library itself doesn't need to depend on those things) and get the platform-specific native handle from it.
from nativefiledialog-extended.
Yes, I understand that passing the handle to the window would break compatibility.
That is why I have made this proposal that in the worst case (the window handle is not found and find_main_window returns nullptr), it would be the current situation.
from nativefiledialog-extended.
Sorry, I think I wasn't very clear.
I don't think the logic of find_main_window should be part of NFD, since it is guesswork, and for multi-window applications it might bring the wrong window to the top. Instead, I think NFD ought to have a new interface that will allow the user to pass in a native window handle, and the user should implement their own find_main_window hack if they want to do so (or better, figure out the correct window handle through a more proper way and pass that to NFD).
This should be implementable after #92 is implemented.
from nativefiledialog-extended.
Related Issues (20)
- Use GitHub Actions to let contributors open PRs for wiki pages HOT 2
- How does this project work? HOT 8
- Consider documentation website? HOT 2
- [PR for wiki] Add overview comments & move bindings to readme HOT 1
- Consider comparison of other native file dialog libraries? HOT 2
- WebAssembly (emscripten) support HOT 3
- Setting up Xcode search path for nfd.hpp HOT 5
- Try to use portals, and fall back on GTK HOT 3
- Universal Bindings HOT 3
- Doxygen HOT 6
- Arm64 Support HOT 10
- CI bug? HOT 2
- I made a C# binding HOT 32
- OpenDialog with portal backend allows folders to be picked HOT 1
- Standalone Library build instructions always build Debug version HOT 1
- How to use NFD_OpenDialog(, , , default_path) HOT 3
- Not able to import file with non-ASCII characters in the path on Windows HOT 3
- PickFolder on Portal backend should support default path too HOT 1
- How to set the dialog title? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nativefiledialog-extended.