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

Alexandre Julliard julliard at winehq.org
Thu Dec 30 16:11:34 CST 2021


Module: wine
Branch: master
Commit: 5f0dcf79185941c4faff35d1cc9c758160f3a27d
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=5f0dcf79185941c4faff35d1cc9c758160f3a27d

Author: Zhiyi Zhang <zzhang at codeweavers.com>
Date:   Thu Dec 30 16:10:35 2021 +0800

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 at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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);
 




More information about the wine-cvs mailing list