Zhiyi Zhang : comctl32/treeview: Do not draw client edge without WS_EX_CLIENTEDGE.
Module: wine Branch: stable Commit: 95eb14dd342ae44a4d440bb8e2550e0cdf7a506a URL: https://gitlab.winehq.org/wine/wine/-/commit/95eb14dd342ae44a4d440bb8e2550e0... Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Thu Feb 10 14:57:29 2022 +0800 comctl32/treeview: Do not draw client edge without WS_EX_CLIENTEDGE. Fix foobar2000 having an extra edge around tree view non-client size box. Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit 8ce869f40b0887bd465f27ac1db7393067540aba) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/comctl32/treeview.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c index f4a387dd0d2..6399115525d 100644 --- a/dlls/comctl32/treeview.c +++ b/dlls/comctl32/treeview.c @@ -5447,18 +5447,25 @@ TREEVIEW_MouseMove (TREEVIEW_INFO * infoPtr, LPARAM lParam) /* Draw themed border */ static BOOL TREEVIEW_NCPaint (const TREEVIEW_INFO *infoPtr, HRGN region, LPARAM lParam) { - HTHEME theme = GetWindowTheme (infoPtr->hwnd); + int cxEdge, cyEdge; + LONG ex_style; + HTHEME theme; HDC dc; RECT r; HRGN cliprgn; - int cxEdge = GetSystemMetrics (SM_CXEDGE), - cyEdge = GetSystemMetrics (SM_CYEDGE); + ex_style = GetWindowLongW(infoPtr->hwnd, GWL_EXSTYLE); + if (!(ex_style & WS_EX_CLIENTEDGE)) + return DefWindowProcW(infoPtr->hwnd, WM_NCPAINT, (WPARAM)region, lParam); + + theme = GetWindowTheme(infoPtr->hwnd); if (!theme) return DefWindowProcW (infoPtr->hwnd, WM_NCPAINT, (WPARAM)region, lParam); GetWindowRect(infoPtr->hwnd, &r); + cxEdge = GetSystemMetrics(SM_CXEDGE); + cyEdge = GetSystemMetrics(SM_CYEDGE); cliprgn = CreateRectRgn (r.left + cxEdge, r.top + cyEdge, r.right - cxEdge, r.bottom - cyEdge); if (region != (HRGN)1)
participants (1)
-
Alexandre Julliard