diff --git a/src/gpu/d3d11/SDL_gpu_d3d11.c b/src/gpu/d3d11/SDL_gpu_d3d11.c index 52d26a9f93d73..a7472fc136c80 100644 --- a/src/gpu/d3d11/SDL_gpu_d3d11.c +++ b/src/gpu/d3d11/SDL_gpu_d3d11.c @@ -5026,7 +5026,7 @@ static bool D3D11_INTERNAL_OnWindowResize(void *userdata, SDL_Event *e) { SDL_Window *w = (SDL_Window *)userdata; D3D11WindowData *data; - if (e->type == SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED) { + if (e->type == SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED && e->window.windowID == SDL_GetWindowID(w)) { data = D3D11_INTERNAL_FetchWindowData(w); data->needsSwapchainRecreate = true; } diff --git a/src/gpu/d3d12/SDL_gpu_d3d12.c b/src/gpu/d3d12/SDL_gpu_d3d12.c index f18c8797bf054..20a6367ee48f4 100644 --- a/src/gpu/d3d12/SDL_gpu_d3d12.c +++ b/src/gpu/d3d12/SDL_gpu_d3d12.c @@ -5977,7 +5977,7 @@ static bool D3D12_INTERNAL_OnWindowResize(void *userdata, SDL_Event *e) { SDL_Window *w = (SDL_Window *)userdata; D3D12WindowData *data; - if (e->type == SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED) { + if (e->type == SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED && e->window.windowID == SDL_GetWindowID(w)) { data = D3D12_INTERNAL_FetchWindowData(w); data->needsSwapchainRecreate = true; } diff --git a/src/gpu/vulkan/SDL_gpu_vulkan.c b/src/gpu/vulkan/SDL_gpu_vulkan.c index aeb88d581e62f..280b2bacca9f3 100644 --- a/src/gpu/vulkan/SDL_gpu_vulkan.c +++ b/src/gpu/vulkan/SDL_gpu_vulkan.c @@ -9329,7 +9329,7 @@ static bool VULKAN_INTERNAL_OnWindowResize(void *userdata, SDL_Event *e) { SDL_Window *w = (SDL_Window *)userdata; WindowData *data; - if (e->type == SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED) { + if (e->type == SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED && e->window.windowID == SDL_GetWindowID(w)) { data = VULKAN_INTERNAL_FetchWindowData(w); data->needsSwapchainRecreate = true; }