Browse Source

Restore window minimum and maximum size if it is recreated

Fixes https://github.com/libsdl-org/SDL/issues/8805
Sam Lantinga 1 year ago
parent
commit
fb2d7ed83e
1 changed files with 8 additions and 0 deletions
  1. 8 0
      src/video/SDL_video.c

+ 8 - 0
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);
     }