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)
From: Vladislav Timonin timoninvlad@yandex.ru
Depending on the theme, if there was a header, the border ends up painted lower than it should be, and clipped by the header. --- dlls/comctl32/listview.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 7c394d60273..13df8567c56 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -10701,6 +10701,7 @@ static LRESULT LISTVIEW_NCPaint(const LISTVIEW_INFO *infoPtr, HRGN region) HRGN cliprgn; int cxEdge = GetSystemMetrics (SM_CXEDGE), cyEdge = GetSystemMetrics (SM_CYEDGE); + DTBGOPTS dtbg_opts;
if (!theme || !(exstyle & WS_EX_CLIENTEDGE)) return DefWindowProcW (infoPtr->hwndSelf, WM_NCPAINT, (WPARAM)region, 0); @@ -10713,17 +10714,24 @@ static LRESULT LISTVIEW_NCPaint(const LISTVIEW_INFO *infoPtr, HRGN region) CombineRgn (cliprgn, cliprgn, region, RGN_AND);
OffsetRect(&r, -r.left, -r.top); + + dc = GetDCEx(infoPtr->hwndSelf, region, DCX_WINDOW|DCX_INTERSECTRGN); + + if (IsThemeBackgroundPartiallyTransparent (theme, 0, 0)) + DrawThemeParentBackground(infoPtr->hwndSelf, dc, &r); + + dtbg_opts.dwSize = sizeof(DTBGOPTS); + dtbg_opts.dwFlags = DTBG_OMITCONTENT; + DrawThemeBackgroundEx(theme, dc, 0, 0, &r, &dtbg_opts); + if (infoPtr->hwndHeader && LISTVIEW_IsHeaderEnabled(infoPtr)) { GetWindowRect(infoPtr->hwndHeader, &window_rect); r.top = min(r.bottom, r.top + window_rect.bottom - window_rect.top); } + dtbg_opts.dwFlags = DTBG_OMITBORDER; + DrawThemeBackgroundEx(theme, dc, 0, 0, &r, &dtbg_opts);
- dc = GetDCEx(infoPtr->hwndSelf, region, DCX_WINDOW|DCX_INTERSECTRGN); - - if (IsThemeBackgroundPartiallyTransparent (theme, 0, 0)) - DrawThemeParentBackground(infoPtr->hwndSelf, dc, &r); - DrawThemeBackground (theme, dc, 0, 0, &r, 0); ReleaseDC(infoPtr->hwndSelf, dc);
/* Call default proc to get the scrollbars etc. painted */