wayland: Make sure the logical window size can't go to zero.

libdecor can send a size of zero as a valid value, the use of which will close the window. Make sure the minimum width/height are clamped to a minimum of 1.
main
Frank Praznik 2024-01-24 11:24:16 -05:00
parent b97cda226f
commit 879ba46ade
1 changed files with 4 additions and 0 deletions

View File

@ -1714,6 +1714,10 @@ void Wayland_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window)
wl_surface_commit(data->surface);
}
/* Make sure the window can't be resized to 0 or it can be spuriously closed by the window manager. */
data->system_limits.min_width = SDL_max(data->system_limits.min_width, 1);
data->system_limits.min_height = SDL_max(data->system_limits.min_height, 1);
/* Unlike the rest of window state we have to set this _after_ flushing the
* display, because we need to create the decorations before possibly hiding
* them immediately afterward.