From 0b07bb8566b60cf7c2d7410999a0db5a011b8ef8 Mon Sep 17 00:00:00 2001 From: Jinoh Kang Date: Tue, 15 Mar 2022 02:40:03 +0900 Subject: [PATCH] comctl32: Always paint SS_BITMAP static control background with WM_CTLCOLORSTATIC brush. This is consistent with the behaviour of other static control styles. Signed-off-by: Jinoh Kang --- dlls/comctl32/static.c | 7 ++++--- dlls/comctl32/tests/static.c | 1 - 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/comctl32/static.c b/dlls/comctl32/static.c index 3151cda6552..c09655da903 100644 --- a/dlls/comctl32/static.c +++ b/dlls/comctl32/static.c @@ -849,13 +849,16 @@ static void STATIC_PaintBitmapfn(HWND hwnd, HDC hdc, HBRUSH hbrush, DWORD style { HDC hMemDC; HBITMAP hBitmap, oldbitmap; + RECT rcClient; + + GetClientRect( hwnd, &rcClient ); + FillRect( hdc, &rcClient, hbrush ); if ((hBitmap = STATIC_GetImage( hwnd, IMAGE_BITMAP, style )) && (GetObjectType(hBitmap) == OBJ_BITMAP) && (hMemDC = CreateCompatibleDC( hdc ))) { BITMAP bm; - RECT rcClient; LOGBRUSH brush; BLENDFUNCTION blend = { AC_SRC_OVER, 0, 255, AC_SRC_ALPHA }; struct static_extra_info *extra = get_extra_ptr( hwnd, FALSE ); @@ -870,10 +873,8 @@ static void STATIC_PaintBitmapfn(HWND hwnd, HDC hdc, HBRUSH hbrush, DWORD style if (brush.lbStyle == BS_SOLID) SetBkColor(hdc, brush.lbColor); } - GetClientRect(hwnd, &rcClient); if (style & SS_CENTERIMAGE) { - FillRect( hdc, &rcClient, hbrush ); rcClient.left = (rcClient.right - rcClient.left)/2 - bm.bmWidth/2; rcClient.top = (rcClient.bottom - rcClient.top)/2 - bm.bmHeight/2; rcClient.right = rcClient.left + bm.bmWidth; diff --git a/dlls/comctl32/tests/static.c b/dlls/comctl32/tests/static.c index dbd71539a57..756fed86fe0 100644 --- a/dlls/comctl32/tests/static.c +++ b/dlls/comctl32/tests/static.c @@ -118,7 +118,6 @@ static void test_updates(int style) { HDC hdc = GetDC(hStatic); COLORREF colour = GetPixel(hdc, 10, 10); - todo_wine ok(colour == 0, "Unexpected pixel color.\n"); ReleaseDC(hStatic, hdc); }