Zhiyi Zhang : comctl32/treeview: Do not draw client edge without WS_EX_CLIENTEDGE.

Alexandre Julliard julliard at winehq.org
Thu Feb 10 16:10:30 CST 2022


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

Author: Zhiyi Zhang <zzhang at 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 at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at 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 d00bba8e625..23e87bdce04 100644
--- a/dlls/comctl32/treeview.c
+++ b/dlls/comctl32/treeview.c
@@ -5498,18 +5498,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)




More information about the wine-cvs mailing list