Jinoh Kang : comctl32: Always paint SS_BITMAP static control background with WM_CTLCOLORSTATIC brush.
Alexandre Julliard
julliard at winehq.org
Fri Jun 17 14:51:03 CDT 2022
Module: wine
Branch: master
Commit: 0b07bb8566b60cf7c2d7410999a0db5a011b8ef8
URL: https://source.winehq.org/git/wine.git/?a=commit;h=0b07bb8566b60cf7c2d7410999a0db5a011b8ef8
Author: Jinoh Kang <jinoh.kang.kr at gmail.com>
Date: Tue Mar 15 02:40:03 2022 +0900
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 <jinoh.kang.kr at gmail.com>
---
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);
}
More information about the wine-cvs
mailing list