uxtheme: Do not draw parent background when handling WM_CTLCOLORSTATIC for static controls.

SetBkMode(TRANSPARENT) already indicates that the parent background should remain untouched.
Drawing parent background destroys any previous content that applications drawn and some
applications rely on the content being unchanged.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51914
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zhiyi Zhang 2021-11-04 14:39:45 +08:00 committed by Alexandre Julliard
parent e17aedb284
commit 2f1bbd88ed
2 changed files with 1 additions and 6 deletions

View File

@ -458,7 +458,6 @@ static void test_WM_CTLCOLORSTATIC(void)
todo_wine_if(todo)
ok(mode == OPAQUE, "Expected mode %#x, got %#x.\n", OPAQUE, mode);
color = GetPixel(dialog_hdc, 40, 40);
todo_wine_if(todo)
ok(color == 0, "Expected pixel %#x, got %#x.\n", 0, color);
ReleaseDC(child, child_hdc);

View File

@ -101,15 +101,11 @@ LRESULT WINAPI UXTHEME_DefDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa
HDC controlDC = (HDC)wParam;
HWND controlWnd = (HWND)lParam;
WCHAR controlClass[32];
RECT rc;
GetClassNameW (controlWnd, controlClass, ARRAY_SIZE(controlClass));
if (lstrcmpiW (controlClass, WC_STATICW) == 0)
{
/* Static control - draw parent background and set text to
* transparent, so it looks right on tab pages. */
GetClientRect (controlWnd, &rc);
DrawThemeParentBackground (controlWnd, controlDC, &rc);
SetBkColor(controlDC, GetSysColor(COLOR_BTNFACE));
SetBkMode (controlDC, TRANSPARENT);
/* Return NULL brush since we painted the BG already */