mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-03-22 15:35:09 +00:00
If the client rect is empty, use the last known window size
This happens on Windows 11 with fullscreen desktop windows when the desktop is brought up with the Windows+D shortcut. Fixes https://github.com/libsdl-org/SDL/issues/7419 (cherry picked from commit 2ca727aec6f5f264620f80999beb5ef77eefec4a)
This commit is contained in:
parent
22de91a947
commit
46d143376a
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue