mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-08-17 09:21:59 +08:00
gdk: Send window resize events on Xbox (#16158)
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user