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=52433 Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/comctl32/button.c | 5 +++++ dlls/comctl32/tests/misc.c | 15 ++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c index 14b2200afed..1349e10c4c0 100644 --- a/dlls/comctl32/button.c +++ b/dlls/comctl32/button.c @@ -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) { diff --git a/dlls/comctl32/tests/misc.c b/dlls/comctl32/tests/misc.c index 09c5b3d6c40..c3de9e68c5a 100644 --- a/dlls/comctl32/tests/misc.c +++ b/dlls/comctl32/tests/misc.c @@ -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)
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=107430
Your paranoid android.
=== w7u_2qxl (32 bit report) ===
comctl32: misc.c:601: Test failed: Test 1 class Button WM_THEMECHANGED: the msg sequence is not complete: expected 0014 - actual 0000 misc.c:601: Test failed: Test 2 class ComboBox WM_THEMECHANGED: the msg sequence is not complete: expected 0014 - actual 0000 misc.c:601: Test failed: Test 4 class SysDateTimePick32 WM_THEMECHANGED: the msg sequence is not complete: expected 0014 - actual 0000 misc.c:601: Test failed: Test 5 class Edit WM_THEMECHANGED: the msg sequence is not complete: expected 0014 - actual 0000 misc.c:601: Test failed: Test 6 class SysHeader32 WM_THEMECHANGED: the msg sequence is not complete: expected 0014 - actual 0000 misc.c:601: Test failed: Test 8 class SysIPAddress32 WM_THEMECHANGED: the msg sequence is not complete: expected 0014 - actual 0000 misc.c:601: Test failed: Test 9 class ListBox WM_THEMECHANGED: the msg sequence is not complete: expected 0014 - actual 0000 misc.c:601: Test failed: Test 10 class SysListView32 WM_THEMECHANGED: the msg sequence is not complete: expected 0014 - actual 0000 misc.c:601: Test failed: Test 11 class SysMonthCal32 WM_THEMECHANGED: the msg sequence is not complete: expected 0014 - actual 0000 misc.c:601: Test failed: Test 13 class SysPager WM_THEMECHANGED: the msg sequence is not complete: expected 0014 - actual 0000 misc.c:601: Test failed: Test 14 class msctls_progress32 WM_THEMECHANGED: the msg sequence is not complete: expected 0014 - actual 0000 misc.c:601: Test failed: Test 16 class Static WM_THEMECHANGED: the msg sequence is not complete: expected 0014 - actual 0000 misc.c:601: Test failed: Test 17 class msctls_statusbar32 WM_THEMECHANGED: the msg sequence is not complete: expected 0014 - actual 0000 misc.c:601: Test failed: Test 19 class SysTabControl32 WM_THEMECHANGED: the msg sequence is not complete: expected 0014 - actual 0000 misc.c:601: Test failed: Test 20 class ToolbarWindow32 WM_THEMECHANGED: the msg sequence is not complete: expected 0014 - actual 0000
On 2/9/22 17:52, Marvin wrote:
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=107430
Your paranoid android.
=== w7u_2qxl (32 bit report) ===
comctl32: misc.c:601: Test failed: Test 1 class Button WM_THEMECHANGED: the msg sequence is not complete: expected 0014 - actual 0000 misc.c:601: Test failed: Test 2 class ComboBox WM_THEMECHANGED: the msg sequence is not complete: expected 0014 - actual 0000 misc.c:601: Test failed: Test 4 class SysDateTimePick32 WM_THEMECHANGED: the msg sequence is not complete: expected 0014 - actual 0000 misc.c:601: Test failed: Test 5 class Edit WM_THEMECHANGED: the msg sequence is not complete: expected 0014 - actual 0000 misc.c:601: Test failed: Test 6 class SysHeader32 WM_THEMECHANGED: the msg sequence is not complete: expected 0014 - actual 0000 misc.c:601: Test failed: Test 8 class SysIPAddress32 WM_THEMECHANGED: the msg sequence is not complete: expected 0014 - actual 0000 misc.c:601: Test failed: Test 9 class ListBox WM_THEMECHANGED: the msg sequence is not complete: expected 0014 - actual 0000 misc.c:601: Test failed: Test 10 class SysListView32 WM_THEMECHANGED: the msg sequence is not complete: expected 0014 - actual 0000 misc.c:601: Test failed: Test 11 class SysMonthCal32 WM_THEMECHANGED: the msg sequence is not complete: expected 0014 - actual 0000 misc.c:601: Test failed: Test 13 class SysPager WM_THEMECHANGED: the msg sequence is not complete: expected 0014 - actual 0000 misc.c:601: Test failed: Test 14 class msctls_progress32 WM_THEMECHANGED: the msg sequence is not complete: expected 0014 - actual 0000 misc.c:601: Test failed: Test 16 class Static WM_THEMECHANGED: the msg sequence is not complete: expected 0014 - actual 0000 misc.c:601: Test failed: Test 17 class msctls_statusbar32 WM_THEMECHANGED: the msg sequence is not complete: expected 0014 - actual 0000 misc.c:601: Test failed: Test 19 class SysTabControl32 WM_THEMECHANGED: the msg sequence is not complete: expected 0014 - actual 0000 misc.c:601: Test failed: Test 20 class ToolbarWindow32 WM_THEMECHANGED: the msg sequence is not complete: expected 0014 - actual 0000
This is from another existing test. I will send a patch to fix these.