wayland: Only dispatch on fullscreen set when the window is visible. Fixes hang-on-startup described in #4572.
diff --git a/src/video/wayland/SDL_waylandwindow.c b/src/video/wayland/SDL_waylandwindow.c
index 49db037..29823e2 100644
--- a/src/video/wayland/SDL_waylandwindow.c
+++ b/src/video/wayland/SDL_waylandwindow.c
@@ -962,7 +962,7 @@ Wayland_SetWindowFullscreen(_THIS, SDL_Window * window,
*
* -flibit
*/
- if (viddata->shell.libdecor) {
+ if (viddata->shell.libdecor && (window->flags & SDL_WINDOW_SHOWN)) {
WAYLAND_wl_display_dispatch(viddata->display);
}
#endif