Zhiyi Zhang : uxtheme: Fall back to default class if the specified subclass is not found.

Alexandre Julliard julliard at winehq.org
Fri Feb 25 07:30:22 CST 2022


Module: wine
Branch: oldstable
Commit: c7436090e4c653b2bbd73f2e459c988faf64c26d
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=c7436090e4c653b2bbd73f2e459c988faf64c26d

Author: Zhiyi Zhang <zzhang at codeweavers.com>
Date:   Mon Jun 21 17:14:43 2021 +0800

uxtheme: Fall back to default class if the specified subclass is not found.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50113
Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 3e9fbda43c6d2f5fd10366f520fc93b0b9234dc0)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 dlls/uxtheme/system.c       | 4 ++++
 dlls/uxtheme/tests/system.c | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/dlls/uxtheme/system.c b/dlls/uxtheme/system.c
index a37e532500a..aaef03f0205 100644
--- a/dlls/uxtheme/system.c
+++ b/dlls/uxtheme/system.c
@@ -634,6 +634,10 @@ HTHEME WINAPI OpenThemeDataEx(HWND hwnd, LPCWSTR pszClassList, DWORD flags)
 
         if (pszUseClassList)
             hTheme = MSSTYLES_OpenThemeClass(pszAppName, pszUseClassList);
+
+        /* Fall back to default class if the specified subclass is not found */
+        if (!hTheme)
+            hTheme = MSSTYLES_OpenThemeClass(NULL, pszUseClassList);
     }
     if(IsWindow(hwnd))
         SetPropW(hwnd, (LPCWSTR)MAKEINTATOM(atWindowTheme), hTheme);
diff --git a/dlls/uxtheme/tests/system.c b/dlls/uxtheme/tests/system.c
index ae4de902730..3f259d08f79 100644
--- a/dlls/uxtheme/tests/system.c
+++ b/dlls/uxtheme/tests/system.c
@@ -127,7 +127,7 @@ todo_wine
         ok(hRes == S_OK, "Expected S_OK, got 0x%08x.\n", hRes);
 
         hTheme = OpenThemeData(hWnd, L"Button");
-        todo_wine ok(!!hTheme, "OpenThemeData failed.\n");
+        ok(!!hTheme, "OpenThemeData failed.\n");
         CloseThemeData(hTheme);
     }
     else




More information about the wine-cvs mailing list