What is the recommended way to create a splash screen in GTK4?
I have an application where I show a GtkWindow initially as a splash screen.
It is undecorated (so that the title bar is not shown).
This works well under X11 but not so much with Wayland.
With X11, the placement of the splash window is above the main dialog window
and it has a drop shadow (like other windows).
With Wayland, the placement is in the top left corner of the display and there is no drop shadow.
Your use case might warrant an in-app loading screen / overlay rather than a separate window for the splash screen, if the main window is visible behind the splash anyways.
Alternatively, you can mark the splash screen window as transient for the main window to tell the compositor that the splash “belongs” to it.
A transient, or even modal transient, above the main window, might make more sense indeed. Or just a regular widget placed on top of all the other ones on the main window.
The linked protocol aims to provide a “splash surface role” to Wayland, which in theory could be used by gtk to create a window that would behave as a “splash screen”. But as mentioned above, it’s not ready, so isn’t in the end very useful for you right now, I’m afraid.