wayland: Make sure the correct cached window dimensions are used when a config size of 0,0 is received

The window may be in a maximized or tiled state, in which case, don't use the floating size.
This commit is contained in:
Frank Praznik
2024-05-23 10:51:44 -04:00
parent b1061a3ec1
commit baacbeb4c4

View File

@@ -777,11 +777,18 @@ static void handle_configure_xdg_toplevel(void *data,
if (window->flags & SDL_WINDOW_RESIZABLE) {
if ((floating && !wind->floating) ||
width == 0 || height == 0) {
/* This happens when we're being restored from a
* non-floating state, so use the cached floating size here.
/* This happens when we're being restored from a non-floating state,
* or the compositor indicates that the size is up to the client, so
* used the cached window size here.
*/
width = window->floating.w;
height = window->floating.h;
if (floating) {
width = window->floating.w;
height = window->floating.h;
} else {
width = window->windowed.w;
height = window->windowed.h;
}
if (wind->scale_to_display) {
wind->requested.logical_width = PixelToPoint(window, width);
wind->requested.logical_height = PixelToPoint(window, height);