From dfa832c5de8671c59150c05e32db9a2883069ab1 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 10 Mar 2023 08:10:06 -0800 Subject: [PATCH] Make sure our pixel size is up to date at window creation This guarantees that the application will always get SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED when a window is created. Fixes https://github.com/libsdl-org/SDL/issues/7441 --- src/video/SDL_video.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 9f36c5644..be9722d51 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -1860,6 +1860,9 @@ SDL_Window *SDL_CreateWindow(const char *title, int w, int h, Uint32 flags) SDL_UpdateFullscreenMode(window, SDL_TRUE); } + /* Make sure window pixel size is up to date */ + SDL_CheckWindowPixelSizeChanged(window); + return window; }