cage-kiosk / cage

A Wayland kiosk
https://www.hjdskes.nl/projects/cage
MIT License
1.24k stars 80 forks source link

How to get the wlr_scene_node of a spawned client #369

Open ZirixCZ opened 1 month ago

ZirixCZ commented 1 month ago

I'm attempting to implement the splash screen functionality mentioned in https://github.com/cage-kiosk/cage/issues/366. I got stuck on getting the wlr_scene_node of the spawned client. Looking on the tinywl implementation did not help. Here's my WIP code. There's a line number in the link leading to the function I need the node for. https://github.com/ZirixCZ/cage-19-dev/commit/29acde5e303d4e57c6e369d697049a97d7692929#diff-59cf298203b513bf1fca0344f379fd54feac89ed89fb7c083ae558a34b7079e3R640

It is for the wlr_scene_node_raise_to_top which I believe is just what I need to make this all work. Right now, even though I launch the splash screen first, the second, slow app, will always display over it.

emersion commented 3 weeks ago

366 is not about running a splash screen application inside cage before the final application starts up. It's about leaving alone the last image displayed by the previous DRM master (plymouth) until the final application submits its first frame.

ZirixCZ commented 3 weeks ago

I am fully aware that my solution could not be used in production. It simply is something I want to try implementing. I'd like to show an overlay (or a splash client) for a set period of time (not until the main client commits, since it can commit a loading state of its own and it'd also introduce more complexity). I got stuck on implementing the wlr_scene_node_raise_to_top function. Though now I figured that calling this function wouldn't make the window be in front at all the times, since the slow app would overlay on top of it when it commits for the first time I believe. The idea was to call wlr_scene_node_raise_to_top in xdg_shell with the splash node everytime toplevel changes. Is there a better way to make one client always be on the top level? Thanks.