From 4d7041a6ce42c0186f59fb67090eb4364ee1d33d Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Sat, 18 Aug 2001 16:10:52 +0000 Subject: [PATCH] Explicitly check for CS_PARENTDC in WM_ERASEBKGND handling. --- windows/defwnd.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/windows/defwnd.c b/windows/defwnd.c index 11277947662..95a3df276ae 100644 --- a/windows/defwnd.c +++ b/windows/defwnd.c @@ -461,10 +461,13 @@ static LRESULT DEFWND_DefWinProc( WND *wndPtr, UINT msg, WPARAM wParam, HBRUSH hbr = GetClassLongW( wndPtr->hwndSelf, GCL_HBRBACKGROUND ); if (!hbr) return 0; - /* GetClientRect used to be GetClipBox, but it is not what - * Windows does, and it breaks badly with CS_PARENTDC */ - GetClientRect( wndPtr->hwndSelf, &rect ); - DPtoLP( hdc, (LPPOINT)&rect, 2 ); + if (GetClassLongW( wndPtr->hwndSelf, GCL_STYLE ) & CS_PARENTDC) + { + /* can't use GetClipBox with a parent DC or we fill the whole parent */ + GetClientRect( wndPtr->hwndSelf, &rect ); + DPtoLP( hdc, (LPPOINT)&rect, 2 ); + } + else GetClipBox( hdc, &rect ); FillRect( hdc, &rect, hbr ); return 1; } -- 2.11.4.GIT