[PATCH 2/4] uxtheme: Call DefDlgProc() if drawing tab body in a dialog fails.
Zhiyi Zhang
zzhang at codeweavers.com
Tue Nov 30 00:50:40 CST 2021
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>
---
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;
--
2.32.0
More information about the wine-devel
mailing list