From fb2d7ed83efbeebeb537ea8c17694585c05ce8e3 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Mon, 15 Jan 2024 16:33:49 -0800
Subject: [PATCH] Restore window minimum and maximum size if it is recreated
Fixes https://github.com/libsdl-org/SDL/issues/8805
---
src/video/SDL_video.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c
index 8efd6f0dd748..34e33db84fc1 100644
--- a/src/video/SDL_video.c
+++ b/src/video/SDL_video.c
@@ -2339,6 +2339,14 @@ int SDL_RecreateWindow(SDL_Window *window, Uint32 flags)
_this->SetWindowIcon(_this, window, window->icon);
}
+ if (_this->SetWindowMinimumSize && (window->min_w || window->min_h)) {
+ _this->SetWindowMinimumSize(_this, window);
+ }
+
+ if (_this->SetWindowMaximumSize && (window->max_w || window->max_h)) {
+ _this->SetWindowMaximumSize(_this, window);
+ }
+
if (window->hit_test) {
_this->SetWindowHitTest(window, SDL_TRUE);
}