From e118805eefc9a64b8deedf9ad9e96b90c1c0a68e Mon Sep 17 00:00:00 2001 From: Vincent Wei Date: Sat, 16 Sep 2023 15:43:07 +0800 Subject: [PATCH] fix a bug of GetUpdateRect: intersect bouding rectangle of invalid region with client rect --- src/gui/window.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/window.c b/src/gui/window.c index 556a6330..d5849462 100644 --- a/src/gui/window.c +++ b/src/gui/window.c @@ -5585,11 +5585,13 @@ BOOL GUIAPI ValidateRegion (HWND hWnd, const CLIPRGN* pRgn) BOOL GUIAPI GetUpdateRect (HWND hWnd, RECT* update_rect) { PMAINWIN pWin; + RECT rcClient; MG_CHECK_RET (MG_IS_NORMAL_WINDOW(hWnd), FALSE); pWin = MG_GET_WINDOW_PTR (hWnd); - *update_rect = pWin->InvRgn.rgn.rcBound; + GetClientRect(hWnd, &rcClient); + IntersectRect(update_rect, &pWin->InvRgn.rgn.rcBound, &rcClient); return TRUE; }