Fix Emscripten rendering after SDL3 window size change

SDL3 commit 1a27b5b838f added code that overwrites window dimensions
with CSS values when external_size is detected. This broke rendering
because the window was created with browser dimensions instead of
the requested 640x480.

Force the correct window size immediately after creation to ensure
the renderer initializes with the proper dimensions.
This commit is contained in:
Christian Semmler 2026-01-30 20:40:47 -08:00
parent 33223d1169
commit 8b5a750379
No known key found for this signature in database
GPG Key ID: 086DAA1360BEEE5C

View File

@ -948,6 +948,12 @@ MxResult IsleApp::SetupWindow()
#endif
window = SDL_CreateWindowWithProperties(props);
#ifdef __EMSCRIPTEN__
// Force correct window size since SDL3 may have picked up CSS dimensions
SDL_SetWindowSize(window, g_targetWidth, g_targetHeight);
#endif
SDL_SetPointerProperty(SDL_GetWindowProperties(window), ISLE_PROP_WINDOW_CREATE_VIDEO_PARAM, &m_videoParam);
if (m_exclusiveFullScreen && m_fullScreen) {