mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-03-06 09:07:05 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user