From 2a0cde8fd5dc7f3f8380dda89ad3300a5c65834c Mon Sep 17 00:00:00 2001 From: Mathieu Eyraud <70028899+meyraud705@users.noreply.github.com> Date: Sun, 16 Jan 2022 09:40:51 +0100 Subject: [PATCH] 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. --- src/video/SDL_video.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index cad77f1a8..dac8d1cc9 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); }