[PATCH] comctl32/listview: Don not paint over header when handling WM_NCPAINT.

Zhiyi Zhang zzhang at codeweavers.com
Thu Dec 30 02:10:35 CST 2021


Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52285
Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
---
 dlls/comctl32/listview.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 41e3db5f9be..9e35f7879b7 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -10537,8 +10537,8 @@ static LRESULT LISTVIEW_NCPaint(const LISTVIEW_INFO *infoPtr, HRGN region)
 {
     LONG exstyle = GetWindowLongW (infoPtr->hwndSelf, GWL_EXSTYLE);
     HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
+    RECT r, window_rect;
     HDC dc;
-    RECT r;
     HRGN cliprgn;
     int cxEdge = GetSystemMetrics (SM_CXEDGE),
         cyEdge = GetSystemMetrics (SM_CYEDGE);
@@ -10552,7 +10552,13 @@ static LRESULT LISTVIEW_NCPaint(const LISTVIEW_INFO *infoPtr, HRGN region)
         r.right - cxEdge, r.bottom - cyEdge);
     if (region != (HRGN)1)
         CombineRgn (cliprgn, cliprgn, region, RGN_AND);
+
     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);
 
-- 
2.32.0



More information about the wine-devel mailing list