-
-
Notifications
You must be signed in to change notification settings - Fork 719
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
question: custom rendering to arbitrary wayland surface #2388
Comments
I'm not familiar with wayland lock screens, but wry does expose methods to render a webview inside other windows which may be helpful. Dioxus could probably expose an API that allows you to do something similar |
Thanks for the response. I did actually try using wry directly, unfortunately wry does not yet have support for spawning from an existing window as a child for wayland as of yet. Wry uses tao, which uses gtk as the backend for their windows on wayland and according to their documentation and examples it doesn't seem possible. quoted from those docs: i assume gtk doesn't have the support for using a foreign surface anymore in gtk4 since it appears the exact sort of call i needed has been removed since the transition from gtk3: https://gitlab.gnome.org/GNOME/gtk/-/issues/2132 |
I've unfortunately given up on the idea for the moment and have opted to use iced instead since I can integrate it directly with wgpu which thankfully can use a foreign surface. though this means I have to implement my own rendering backend for iced since im not using it through winit which comes with a lot of the extras needed for doing it easily. I'd be happy to come back to it if there was some other way which is why I've reached out and asked as an issue lol. |
I'm going to close this issue since i ended up going with an alternative solution. Considering how far downstream the issue ultimately is, as its specific to gtk, i don't think its likely this will change for potentially years even so there seems little value in hoping for an eventual implementation via exposing some method with wry. It would theoretically be possible via an integration with wgpu using blitz but blitz seems like it would need a ton of enhancements to fully support what I'm hoping to achieve as well. lockscreen is complete if anyone's interested! |
Feature Request
Hello, I would like to build a custom lockscreen for wayland using dioxus as the backend for building the UI.
Dioxus and its connected webview provide a great deal of flexibility and simplicity in design and configuration that would be challenging to implement from the ground up using wgpu directly or some other way.
However, restrictions around building a lockscreen make it more complicated than simply spawning a desktop window using dioxus-desktop. Lockscreens typically use the wayland ext-session-lock-v1 protocol which assigns a new wayland surface to render to. There are existing libraries that make implementing the protocol fairly straight-forward such as smithay-toolkit: https://github.com/Smithay/client-toolkit/blob/master/examples/session_lock.rs, however I'm not sure how to connect the two libraries together in a meaningful way.
It seems like i need to find some way to invisibly render dioxus's webview to a hidden surface and then copy the internal buffer from dioxus to the lockscreen surface but I'm not sure if there is even a way to go about doing that.
Implement Suggestion
I saw that dioxus supports custom renderers but that seems like overkill or maybe even the wrong direction since I still want to render it to a webview, just translate the pixels from one location to another. Perhaps there could be some way to expose the underlying wayland components in dioxus-desktop? I'm rather ignorant on the complexities for such a thing.
The text was updated successfully, but these errors were encountered: