Explicitly check for CS_PARENTDC in WM_ERASEBKGND handling.
This commit is contained in:
parent
96c514bdf8
commit
4d7041a6ce
|
@ -461,10 +461,13 @@ static LRESULT DEFWND_DefWinProc( WND *wndPtr, UINT msg, WPARAM wParam,
|
||||||
HBRUSH hbr = GetClassLongW( wndPtr->hwndSelf, GCL_HBRBACKGROUND );
|
HBRUSH hbr = GetClassLongW( wndPtr->hwndSelf, GCL_HBRBACKGROUND );
|
||||||
if (!hbr) return 0;
|
if (!hbr) return 0;
|
||||||
|
|
||||||
/* GetClientRect used to be GetClipBox, but it is not what
|
if (GetClassLongW( wndPtr->hwndSelf, GCL_STYLE ) & CS_PARENTDC)
|
||||||
* Windows does, and it breaks badly with CS_PARENTDC */
|
{
|
||||||
GetClientRect( wndPtr->hwndSelf, &rect );
|
/* can't use GetClipBox with a parent DC or we fill the whole parent */
|
||||||
DPtoLP( hdc, (LPPOINT)&rect, 2 );
|
GetClientRect( wndPtr->hwndSelf, &rect );
|
||||||
|
DPtoLP( hdc, (LPPOINT)&rect, 2 );
|
||||||
|
}
|
||||||
|
else GetClipBox( hdc, &rect );
|
||||||
FillRect( hdc, &rect, hbr );
|
FillRect( hdc, &rect, hbr );
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue