Module: wine Branch: master Commit: 2f1bbd88edc82a41967692b8c339a4b9bb7231f6 URL: https://source.winehq.org/git/wine.git/?a=commit;h=2f1bbd88edc82a41967692b8c...
Author: Zhiyi Zhang zzhang@codeweavers.com Date: Thu Nov 4 14:39:45 2021 +0800
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
---
dlls/comctl32/tests/static.c | 1 - dlls/uxtheme/dialog.c | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/dlls/comctl32/tests/static.c b/dlls/comctl32/tests/static.c index 269dfbb49eb..99738f7b513 100644 --- a/dlls/comctl32/tests/static.c +++ b/dlls/comctl32/tests/static.c @@ -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); diff --git a/dlls/uxtheme/dialog.c b/dlls/uxtheme/dialog.c index 043346b24e2..a949bfc6579 100644 --- a/dlls/uxtheme/dialog.c +++ b/dlls/uxtheme/dialog.c @@ -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 */