Depending on the theme, if there was a header, the border ends up painted lower than it should be, and clipped by the header.
7-Zip file manager, the reason why the offset was added in 5f0dcf79185941c4faff35d1cc9c758160f3a27d in the first place, still renders correctly.
Before:
![before](/uploads/8321f45c657469278b2787edfa147b20/before.png)
After:
![after](/uploads/013241f4cd3b893c7f4073b6a9fe8119/after.png)
EDIT1: Actually compared screenshots of 7-Zip file manager and looks like the headers are now painted consistently after highlighting them.
![7zFM-before-hilite](/uploads/64fe3fb80002c847c2e9270337bab4e8/7zFM-before-hilite.png)
![7zFM-after-hilite](/uploads/4db4778c2ad6d27eddbd4a1202b41881/7zFM-after-hilite.png)
-- v3: comctl32/listview: Exclude header area in WM_NCPAINT.
From: Vladislav Timonin timoninvlad@yandex.ru
An improvement of 5f0dcf79185941c4faff35d1cc9c758160f3a27d, which, depending on theme, had an issue with drawing the top border clipped inside the header. --- dlls/comctl32/listview.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 7c394d60273..07bea8574b6 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -10712,15 +10712,15 @@ static LRESULT LISTVIEW_NCPaint(const LISTVIEW_INFO *infoPtr, HRGN region) if (region != (HRGN)1) CombineRgn (cliprgn, cliprgn, region, RGN_AND);
- OffsetRect(&r, -r.left, -r.top); + dc = GetDCEx(infoPtr->hwndSelf, region, DCX_WINDOW | DCX_INTERSECTRGN); if (infoPtr->hwndHeader && LISTVIEW_IsHeaderEnabled(infoPtr)) { GetWindowRect(infoPtr->hwndHeader, &window_rect); - r.top = min(r.bottom, r.top + window_rect.bottom - window_rect.top); + OffsetRect(&window_rect, -r.left, -r.top); + ExcludeClipRect(dc, window_rect.left, window_rect.top, window_rect.right, window_rect.bottom); }
- dc = GetDCEx(infoPtr->hwndSelf, region, DCX_WINDOW|DCX_INTERSECTRGN); - + OffsetRect(&r, -r.left, -r.top); if (IsThemeBackgroundPartiallyTransparent (theme, 0, 0)) DrawThemeParentBackground(infoPtr->hwndSelf, dc, &r); DrawThemeBackground (theme, dc, 0, 0, &r, 0);
This merge request was approved by Zhiyi Zhang.
By the way, the missing header issue in listview in winecfg is a regression from ab82ff093aa716e8927ca782585d44d399b7fe77. So it would be nice to include this in 8.0
This merge request was approved by Nikolay Sivov.