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

Linux/Wayland new feature: Accept native parent window handle #153

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

Conversation

btzy
Copy link
Owner

@btzy btzy commented Dec 6, 2024

#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.

@btzy btzy force-pushed the nativewindow-wayland branch 8 times, most recently from 28e9745 to e703e7a Compare December 8, 2024 18:20
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.

1 participant