From 07eda4280882fdb4d4999cdcd3074f5a187e3c1a Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Sun, 11 May 2003 02:58:53 +0000 Subject: [PATCH] Fix the logic for setting the lps->fErase flag in BeginPaint. --- dlls/user/painting.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/user/painting.c b/dlls/user/painting.c index 1faada0097d..46ab96c1578 100644 --- a/dlls/user/painting.c +++ b/dlls/user/painting.c @@ -225,13 +225,18 @@ HDC WINAPI BeginPaint( HWND hwnd, PAINTSTRUCT *lps ) lps->hdc, lps->rcPaint.left, lps->rcPaint.top, lps->rcPaint.right, lps->rcPaint.bottom ); if (!(wndPtr = WIN_GetPtr( hwnd )) || wndPtr == WND_OTHER_PROCESS) return 0; - lps->fErase = !(wndPtr->flags & WIN_NEEDS_ERASEBKGND); + lps->fErase = (wndPtr->flags & WIN_NEEDS_ERASEBKGND) != 0; wndPtr->flags &= ~WIN_NEEDS_ERASEBKGND; WIN_ReleasePtr( wndPtr ); - if (!lps->fErase) + if (lps->fErase) lps->fErase = !SendMessageA( hwnd, bIcon ? WM_ICONERASEBKGND : WM_ERASEBKGND, (WPARAM)lps->hdc, 0 ); + + TRACE("hdc = %p box = (%ld,%ld - %ld,%ld), fErase = %d\n", + lps->hdc, lps->rcPaint.left, lps->rcPaint.top, lps->rcPaint.right, lps->rcPaint.bottom, + lps->fErase); + return lps->hdc; }