From c59ac249d283a04401677f5541b69dc5c899e962 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 6 Feb 2025 14:34:26 -0800 Subject: [PATCH] Revert "wayland: Don't send size events while the window is hidden" This reverts commit 0825d07a43a891350e6ae7ea02912c87eb1db952. It turns out that resizing while hidden is fine, the real problem in https://github.com/libsdl-org/sdl2-compat/issues/268 is that SDL2 did not send an initial resize event and SDL3 does, which we're fixing in a better way in sdl2-compat. --- src/video/wayland/SDL_waylandwindow.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/video/wayland/SDL_waylandwindow.c b/src/video/wayland/SDL_waylandwindow.c index 2cec73cac2..ebf79a2609 100644 --- a/src/video/wayland/SDL_waylandwindow.c +++ b/src/video/wayland/SDL_waylandwindow.c @@ -441,15 +441,13 @@ static bool ConfigureWindowGeometry(SDL_Window *window) */ SetMinMaxDimensions(window); - if (data->shell_surface_status != WAYLAND_SHELL_SURFACE_STATUS_HIDDEN) { - // Unconditionally send the window and drawable size, the video core will deduplicate when required. - if (!data->scale_to_display) { - SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_RESIZED, window_width, window_height); - } else { - SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_RESIZED, data->current.pixel_width, data->current.pixel_height); - } - SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED, data->current.pixel_width, data->current.pixel_height); + // Unconditionally send the window and drawable size, the video core will deduplicate when required. + if (!data->scale_to_display) { + SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_RESIZED, window_width, window_height); + } else { + SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_RESIZED, data->current.pixel_width, data->current.pixel_height); } + SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED, data->current.pixel_width, data->current.pixel_height); /* Send an exposure event if the window is in the shown state and the size has changed, * even if the window is occluded, as the client needs to commit a new frame for the