Linux/Wayland new feature: Accept native parent window handle #153
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#136 added support for passing a parent window handle, ensuring that the file dialog always stays on top of the parent window and other platform-specific effects. Support was not added for Wayland then, due to implementation complexity and the scarcity of good documentation for the unstable xdg-foreign protocol for Wayland. This PR adds this missing support.
Under Wayland, a process cannot simply hand over a window handle to another process. The sending process calls a Wayland function that takes a window handle and returns a string token representing it (known as exporting the window), and then sends that token over to the receiving process. The receiving process then calls another Wayland function that takes the string token and returns a "foreign" window handle (known as importing the window). The receiving process can then make this "foreign" window the transient parent of its own windows.
NOCOMMIT: This PR will currently cause NFDe to have a runtime dependency on wayland-client, which provide the exporting and importing APIs. This is undesirable as it will cause applications using NFDe to fail to start on a pure X11 system.