gdk: Send window resize events on Xbox (#16158)

This commit is contained in:
Caleb Cornett
2026-08-16 12:12:09 -04:00
committed by GitHub
parent 11a9d3212e
commit c80d68fde5

View File

@@ -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: