From ed007a4d8137ca848d3f8d829c92b49b103e3af7 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 6 Sep 2009 15:04:38 +0000 Subject: [PATCH] Fixed bug where minimized windows get zero width/height --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403786 --- src/video/win32/SDL_win32events.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/video/win32/SDL_win32events.c b/src/video/win32/SDL_win32events.c index 92acdcc80..5dcbfa765 100644 --- a/src/video/win32/SDL_win32events.c +++ b/src/video/win32/SDL_win32events.c @@ -528,7 +528,10 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) int w, h; Uint32 window_flags; - GetClientRect(hwnd, &rect); + if (!GetClientRect(hwnd, &rect) || + (rect.right == rect.left && rect.bottom == rect.top)) { + break; + } ClientToScreen(hwnd, (LPPOINT) & rect); ClientToScreen(hwnd, (LPPOINT) & rect + 1);