Module: wine Branch: master Commit: 87f1a380190aeb69e486c743f485f4a286592459 URL: https://gitlab.winehq.org/wine/wine/-/commit/87f1a380190aeb69e486c743f485f4a...
Author: Dmitry Timoshkov dmitry@baikal.ru Date: Thu Nov 2 14:19:06 2023 +0300
uxtheme: Move fall back to default class to MSSTYLES_OpenThemeClass().
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru
---
dlls/uxtheme/msstyles.c | 7 +++++++ dlls/uxtheme/system.c | 4 ---- dlls/uxtheme/tests/system.c | 2 -- 3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/dlls/uxtheme/msstyles.c b/dlls/uxtheme/msstyles.c index a9b46f8ef22..4c67e3b15c5 100644 --- a/dlls/uxtheme/msstyles.c +++ b/dlls/uxtheme/msstyles.c @@ -1079,6 +1079,10 @@ PTHEME_CLASS MSSTYLES_OpenThemeClass(LPCWSTR pszAppName, LPCWSTR pszClassList, U cls = MSSTYLES_FindClass(tfActiveTheme, szAppName, szClassName); else cls = MSSTYLES_FindClass(tfActiveTheme, pszAppName, szClassName); + + /* Fall back to default class if the specified subclass is not found */ + if (!cls) cls = MSSTYLES_FindClass(tfActiveTheme, NULL, szClassName); + if(cls) break; } if(!cls && *start) { @@ -1087,6 +1091,9 @@ PTHEME_CLASS MSSTYLES_OpenThemeClass(LPCWSTR pszAppName, LPCWSTR pszClassList, U cls = MSSTYLES_FindClass(tfActiveTheme, szAppName, szClassName); else cls = MSSTYLES_FindClass(tfActiveTheme, pszAppName, szClassName); + + /* Fall back to default class if the specified subclass is not found */ + if (!cls) cls = MSSTYLES_FindClass(tfActiveTheme, NULL, szClassName); } if(cls) { TRACE("Opened app %s, class %s from list %s\n", debugstr_w(cls->szAppName), debugstr_w(cls->szClassName), debugstr_w(pszClassList)); diff --git a/dlls/uxtheme/system.c b/dlls/uxtheme/system.c index 2c041356930..83cbaea5dfa 100644 --- a/dlls/uxtheme/system.c +++ b/dlls/uxtheme/system.c @@ -641,10 +641,6 @@ static HTHEME open_theme_data(HWND hwnd, LPCWSTR pszClassList, DWORD flags, UINT
if (pszUseClassList) hTheme = MSSTYLES_OpenThemeClass(pszAppName, pszUseClassList, dpi); - - /* Fall back to default class if the specified subclass is not found */ - if (!hTheme) - hTheme = MSSTYLES_OpenThemeClass(NULL, pszUseClassList, dpi); } if(IsWindow(hwnd)) SetPropW(hwnd, (LPCWSTR)MAKEINTATOM(atWindowTheme), hTheme); diff --git a/dlls/uxtheme/tests/system.c b/dlls/uxtheme/tests/system.c index de9419a032a..6c7e87c1040 100644 --- a/dlls/uxtheme/tests/system.c +++ b/dlls/uxtheme/tests/system.c @@ -583,9 +583,7 @@ static void test_OpenThemeData(void)
SetLastError(0xdeadbeef); hTheme = OpenThemeData(hWnd, L"deadbeef::treeview;dead::beef"); - todo_wine ok(hTheme != NULL, "OpenThemeData() failed\n"); - todo_wine ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got 0x%08lx\n", GetLastError()); CloseThemeData(hTheme);