Zhiyi Zhang : uxtheme: Call DefDlgProc() if drawing tab body in a dialog fails.

Alexandre Julliard julliard at winehq.org
Wed Dec 1 15:23:49 CST 2021


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

Author: Zhiyi Zhang <zzhang at codeweavers.com>
Date:   Tue Nov 30 14:50:40 2021 +0800

uxtheme: Call DefDlgProc() if drawing tab body in a dialog fails.

Some third party themes have tab body part defined but with its ImageSelectType set to IST_NONE.
In this case, DrawThemeBackground() will fail to draw the background.

Fix track bar black background in winecfg when using VLT theme.

Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/uxtheme/dialog.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/dlls/uxtheme/dialog.c b/dlls/uxtheme/dialog.c
index a949bfc6579..d0055e013a0 100644
--- a/dlls/uxtheme/dialog.c
+++ b/dlls/uxtheme/dialog.c
@@ -38,8 +38,9 @@ LRESULT WINAPI UXTHEME_DefDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa
     static const WCHAR themeClass[] = L"Window";
     BOOL themingActive = IsThemeDialogTextureEnabled (hWnd);
     BOOL doTheming = themingActive && (theme != NULL);
+    HRESULT hr = E_FAIL;
     LRESULT result;
-      
+
     switch (msg)
     {
     case WM_CREATE:
@@ -78,13 +79,11 @@ LRESULT WINAPI UXTHEME_DefDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa
                         NULL);
 #endif
                     return user_api.pDefDlgProc(hWnd, msg, wParam, lParam, unicode);
-                else 
-                /* We might have gotten a TAB theme class, so check if we can 
-                 * draw as a tab page. */
-                if (IsThemePartDefined (theme, TABP_BODY, 0))
-                    DrawThemeBackground (theme, (HDC)wParam, TABP_BODY, 0, &rc, 
-                        NULL);
-                else
+                /* We might have gotten a TAB theme class, so check if we can draw as a tab page */
+                else if (IsThemePartDefined(theme, TABP_BODY, 0))
+                    hr = DrawThemeBackground(theme, (HDC)wParam, TABP_BODY, 0, &rc, NULL);
+
+                if (FAILED(hr))
                     return user_api.pDefDlgProc(hWnd, msg, wParam, lParam, unicode);
             }
             return 1;




More information about the wine-cvs mailing list