Commit 2a0cde8fd5dc7f3f8380dda89ad3300a5c65834c

Mathieu Eyraud 2022-01-16T09:40:51

Always send SDL_WINDOWEVENT_SIZE_CHANGED when window is resized SDL_WINDOWEVENT_SIZE_CHANGED is now sent even if the resulting size of the window does not match the requested size.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c
index cad77f1..dac8d1c 100644
--- a/src/video/SDL_video.c
+++ b/src/video/SDL_video.c
@@ -2273,12 +2273,14 @@ SDL_SetWindowSize(SDL_Window * window, int w, int h)
             SDL_UpdateFullscreenMode(window, SDL_TRUE);
         }
     } else {
+        int old_w = window->w;
+        int old_h = window->h;
         window->w = w;
         window->h = h;
         if (_this->SetWindowSize) {
             _this->SetWindowSize(_this, window);
         }
-        if (window->w == w && window->h == h) {
+        if (window->w != old_w || window->h != old_h) {
             /* We didn't get a SDL_WINDOWEVENT_RESIZED event (by design) */
             SDL_OnWindowResized(window);
         }