Fix the track bar of Mupen64-RR-Lua input window having black background. Mupen64-RR-Lua doesn't actually handle WM_ERASEBKGND even though it returns nonzero. And tests show that only WM_CTLCOLORSTATIC is sent when drawing themed trackbar background.
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/comctl32/tests/misc.c | 2 +- dlls/comctl32/trackbar.c | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/dlls/comctl32/tests/misc.c b/dlls/comctl32/tests/misc.c index 3a1b5253b58..72674ea5942 100644 --- a/dlls/comctl32/tests/misc.c +++ b/dlls/comctl32/tests/misc.c @@ -883,7 +883,7 @@ static void test_themed_background(void) {WC_TABCONTROLA, 0, drawthemeparentbackground_seq, TRUE}, {TOOLBARCLASSNAMEA, 0, empty_seq, TRUE}, {TOOLTIPS_CLASSA, 0, empty_seq}, - {TRACKBAR_CLASSA, 0, wm_ctlcolorstatic_seq, TRUE}, + {TRACKBAR_CLASSA, 0, wm_ctlcolorstatic_seq}, {WC_TREEVIEWA, 0, treeview_seq}, {UPDOWN_CLASSA, 0, empty_seq}, {WC_SCROLLBARA, 0, scrollbar_seq, TRUE}, diff --git a/dlls/comctl32/trackbar.c b/dlls/comctl32/trackbar.c index 6643752c043..f2cb2a07a8d 100644 --- a/dlls/comctl32/trackbar.c +++ b/dlls/comctl32/trackbar.c @@ -899,6 +899,7 @@ TRACKBAR_Refresh (TRACKBAR_INFO *infoPtr, HDC hdcDst) HBITMAP hOldBmp = 0, hOffScreenBmp = 0; NMCUSTOMDRAW nmcd; int gcdrf, icdrf; + HBRUSH brush;
if (infoPtr->flags & TB_THUMBCHANGED) { TRACKBAR_UpdateThumb (infoPtr); @@ -943,14 +944,9 @@ TRACKBAR_Refresh (TRACKBAR_INFO *infoPtr, HDC hdcDst) /* Erase background */ if (gcdrf == CDRF_DODEFAULT || notify_customdraw(infoPtr, &nmcd, CDDS_PREERASE) != CDRF_SKIPDEFAULT) { - if (GetWindowTheme (infoPtr->hwndSelf)) { - DrawThemeParentBackground (infoPtr->hwndSelf, hdc, 0); - } - else { - HBRUSH brush = (HBRUSH)SendMessageW(infoPtr->hwndNotify, WM_CTLCOLORSTATIC, - (WPARAM)hdc, (LPARAM)infoPtr->hwndSelf); - FillRect (hdc, &rcClient, brush ? brush : GetSysColorBrush(COLOR_BTNFACE)); - } + brush = (HBRUSH)SendMessageW(infoPtr->hwndNotify, WM_CTLCOLORSTATIC, (WPARAM)hdc, + (LPARAM)infoPtr->hwndSelf); + FillRect(hdc, &rcClient, brush ? brush : GetSysColorBrush(COLOR_BTNFACE)); if (gcdrf != CDRF_DODEFAULT) notify_customdraw(infoPtr, &nmcd, CDDS_POSTERASE); }