diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c index d2a0a0546..95a6f8d90 100644 --- a/src/video/windows/SDL_windowsevents.c +++ b/src/video/windows/SDL_windowsevents.c @@ -1349,8 +1349,7 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) RECT rect; float x, y; - if (!GetClientRect(hwnd, &rect) || - (rect.right == rect.left && rect.bottom == rect.top)) { + if (!GetClientRect(hwnd, &rect) || IsRectEmpty(&rect)) { if (inputs) { SDL_small_free(inputs, isstack); } diff --git a/src/video/windows/SDL_windowswindow.c b/src/video/windows/SDL_windowswindow.c index 12f3c0094..82a4282ea 100644 --- a/src/video/windows/SDL_windowswindow.c +++ b/src/video/windows/SDL_windowswindow.c @@ -779,12 +779,12 @@ void WIN_GetWindowSizeInPixels(_THIS, SDL_Window *window, int *w, int *h) HWND hwnd = data->hwnd; RECT rect; - if (GetClientRect(hwnd, &rect)) { + if (GetClientRect(hwnd, &rect) && !IsRectEmpty(&rect)) { *w = rect.right; *h = rect.bottom; } else { - *w = 0; - *h = 0; + *w = window->w; + *h = window->h; } }