From f274f1b2129f3a693a4ef551d5b80ce39954a4d4 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Fri, 30 Jan 2026 20:59:19 -0800 Subject: [PATCH] Fix Emscripten rendering after SDL3 window size change (#776) 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. --- ISLE/isleapp.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ISLE/isleapp.cpp b/ISLE/isleapp.cpp index 1df09cd8..8135b957 100644 --- a/ISLE/isleapp.cpp +++ b/ISLE/isleapp.cpp @@ -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) {