Commit c69d3bb7 authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

comctl32/button: Use the brush from WM_CTLCOLORSTATIC to fill background for…

comctl32/button: Use the brush from WM_CTLCOLORSTATIC to fill background for checkboxes and radio buttons. Fix radio buttons of Mupen64-RR-Lua input window having stale background. Mupen64-RR-Lua doesn't actually handle WM_ERASEBKGND even though it returns nonzero. And tests show that a WM_CTLCOLORSTATIC is sent and the returned brush is used for filling background, even painting over the content from DrawThemeParentBackground(). Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52433Signed-off-by: 's avatarZhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 509d6a1d
......@@ -2796,6 +2796,7 @@ static void CB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, in
UINT btn_type = get_button_type( dwStyle );
int part = (btn_type == BS_RADIOBUTTON) || (btn_type == BS_AUTORADIOBUTTON) ? BP_RADIOBUTTON : BP_CHECKBOX;
NMCUSTOMDRAW nmcd;
HBRUSH brush;
LRESULT cdrf;
LOGFONTW lf;
HWND parent;
......@@ -2859,6 +2860,10 @@ static void CB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, in
if (cdrf & CDRF_SKIPDEFAULT) goto cleanup;
DrawThemeParentBackground(infoPtr->hwnd, hDC, NULL);
/* Tests show that the brush from WM_CTLCOLORSTATIC is used for filling background after a
* DrawThemeParentBackground() call */
brush = (HBRUSH)SendMessageW(parent, WM_CTLCOLORSTATIC, (WPARAM)hDC, (LPARAM)infoPtr->hwnd);
FillRect(hDC, &client_rect, brush ? brush : GetSysColorBrush(COLOR_BTNFACE));
if (cdrf & CDRF_NOTIFYPOSTERASE)
{
......
......@@ -843,14 +843,14 @@ static void test_themed_background(void)
{ANIMATE_CLASSA, 0, empty_seq, TRUE},
{WC_BUTTONA, BS_PUSHBUTTON, pushbutton_seq},
{WC_BUTTONA, BS_DEFPUSHBUTTON, defpushbutton_seq},
{WC_BUTTONA, BS_CHECKBOX, checkbox_seq, TRUE},
{WC_BUTTONA, BS_AUTOCHECKBOX, checkbox_seq, TRUE},
{WC_BUTTONA, BS_RADIOBUTTON, radiobutton_seq, TRUE},
{WC_BUTTONA, BS_3STATE, checkbox_seq, TRUE},
{WC_BUTTONA, BS_AUTO3STATE, checkbox_seq, TRUE},
{WC_BUTTONA, BS_CHECKBOX, checkbox_seq},
{WC_BUTTONA, BS_AUTOCHECKBOX, checkbox_seq},
{WC_BUTTONA, BS_RADIOBUTTON, radiobutton_seq},
{WC_BUTTONA, BS_3STATE, checkbox_seq},
{WC_BUTTONA, BS_AUTO3STATE, checkbox_seq},
{WC_BUTTONA, BS_GROUPBOX, groupbox_seq, TRUE},
{WC_BUTTONA, BS_USERBUTTON, pushbutton_seq},
{WC_BUTTONA, BS_AUTORADIOBUTTON, radiobutton_seq, TRUE},
{WC_BUTTONA, BS_AUTORADIOBUTTON, radiobutton_seq},
{WC_BUTTONA, BS_PUSHBOX, radiobutton_seq, TRUE},
{WC_BUTTONA, BS_OWNERDRAW, ownerdrawbutton_seq},
{WC_BUTTONA, BS_SPLITBUTTON, splitbutton_seq},
......@@ -950,7 +950,8 @@ static void test_themed_background(void)
{
/* WM_CTLCOLORSTATIC is used to fill background */
color = GetPixel(hdc, 40, 40);
todo_wine
/* BS_PUSHBOX is unimplemented on Wine */
todo_wine_if(i == 11)
ok(color == 0x808080, "Expected color %#x, got %#x.\n", 0x808080, color);
}
else if (tests[i].seq == groupbox_seq)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment