From c80d68fde588509314c9961edef885b7a1c84ba6 Mon Sep 17 00:00:00 2001 From: Caleb Cornett Date: Sun, 16 Aug 2026 12:12:09 -0400 Subject: [PATCH] gdk: Send window resize events on Xbox (#16158) --- src/video/windows/SDL_windowsevents.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c index b8cecc7fd5..41e404c6e4 100644 --- a/src/video/windows/SDL_windowsevents.c +++ b/src/video/windows/SDL_windowsevents.c @@ -2499,7 +2499,19 @@ LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara WIN_UpdateDisplayUsableBounds(SDL_GetVideoDevice()); } break; +#else + // Xbox does not support WM_WINDOWPOSCHANGED, so use WM_SIZE instead to detect window resizes + case WM_SIZE: + { + RECT rect; + int w, h; + if (GetClientRect(hwnd, &rect) && WIN_WindowRectValid(&rect)) { + w = rect.right; + h = rect.bottom; + SDL_SendWindowEvent(data->window, SDL_EVENT_WINDOW_RESIZED, w, h); + } + } break; #endif // !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) default: