comctl32/listview: Do not paint over header when handling WM_NCPAINT.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52285
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zhiyi Zhang 2021-12-30 16:10:35 +08:00 committed by Alexandre Julliard
parent ba47d8a2b4
commit 5f0dcf7918
1 changed files with 7 additions and 1 deletions

View File

@ -10537,8 +10537,8 @@ static LRESULT LISTVIEW_NCPaint(const LISTVIEW_INFO *infoPtr, HRGN region)
{ {
LONG exstyle = GetWindowLongW (infoPtr->hwndSelf, GWL_EXSTYLE); LONG exstyle = GetWindowLongW (infoPtr->hwndSelf, GWL_EXSTYLE);
HTHEME theme = GetWindowTheme (infoPtr->hwndSelf); HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
RECT r, window_rect;
HDC dc; HDC dc;
RECT r;
HRGN cliprgn; HRGN cliprgn;
int cxEdge = GetSystemMetrics (SM_CXEDGE), int cxEdge = GetSystemMetrics (SM_CXEDGE),
cyEdge = GetSystemMetrics (SM_CYEDGE); cyEdge = GetSystemMetrics (SM_CYEDGE);
@ -10552,7 +10552,13 @@ static LRESULT LISTVIEW_NCPaint(const LISTVIEW_INFO *infoPtr, HRGN region)
r.right - cxEdge, r.bottom - cyEdge); r.right - cxEdge, r.bottom - cyEdge);
if (region != (HRGN)1) if (region != (HRGN)1)
CombineRgn (cliprgn, cliprgn, region, RGN_AND); CombineRgn (cliprgn, cliprgn, region, RGN_AND);
OffsetRect(&r, -r.left, -r.top); OffsetRect(&r, -r.left, -r.top);
if (infoPtr->hwndHeader && LISTVIEW_IsHeaderEnabled(infoPtr))
{
GetWindowRect(infoPtr->hwndHeader, &window_rect);
r.top = min(r.bottom, r.top + window_rect.bottom - window_rect.top);
}
dc = GetDCEx(infoPtr->hwndSelf, region, DCX_WINDOW|DCX_INTERSECTRGN); dc = GetDCEx(infoPtr->hwndSelf, region, DCX_WINDOW|DCX_INTERSECTRGN);