Commit 179117a6 authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

comctl32/trackbar: Always use brush from WM_CTLCOLORSTATIC to fill background.

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: 's avatarZhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 5c901a04
...@@ -883,7 +883,7 @@ static void test_themed_background(void) ...@@ -883,7 +883,7 @@ static void test_themed_background(void)
{WC_TABCONTROLA, 0, drawthemeparentbackground_seq, TRUE}, {WC_TABCONTROLA, 0, drawthemeparentbackground_seq, TRUE},
{TOOLBARCLASSNAMEA, 0, empty_seq, TRUE}, {TOOLBARCLASSNAMEA, 0, empty_seq, TRUE},
{TOOLTIPS_CLASSA, 0, empty_seq}, {TOOLTIPS_CLASSA, 0, empty_seq},
{TRACKBAR_CLASSA, 0, wm_ctlcolorstatic_seq, TRUE}, {TRACKBAR_CLASSA, 0, wm_ctlcolorstatic_seq},
{WC_TREEVIEWA, 0, treeview_seq}, {WC_TREEVIEWA, 0, treeview_seq},
{UPDOWN_CLASSA, 0, empty_seq}, {UPDOWN_CLASSA, 0, empty_seq},
{WC_SCROLLBARA, 0, scrollbar_seq, TRUE}, {WC_SCROLLBARA, 0, scrollbar_seq, TRUE},
......
...@@ -899,6 +899,7 @@ TRACKBAR_Refresh (TRACKBAR_INFO *infoPtr, HDC hdcDst) ...@@ -899,6 +899,7 @@ TRACKBAR_Refresh (TRACKBAR_INFO *infoPtr, HDC hdcDst)
HBITMAP hOldBmp = 0, hOffScreenBmp = 0; HBITMAP hOldBmp = 0, hOffScreenBmp = 0;
NMCUSTOMDRAW nmcd; NMCUSTOMDRAW nmcd;
int gcdrf, icdrf; int gcdrf, icdrf;
HBRUSH brush;
if (infoPtr->flags & TB_THUMBCHANGED) { if (infoPtr->flags & TB_THUMBCHANGED) {
TRACKBAR_UpdateThumb (infoPtr); TRACKBAR_UpdateThumb (infoPtr);
...@@ -943,14 +944,9 @@ TRACKBAR_Refresh (TRACKBAR_INFO *infoPtr, HDC hdcDst) ...@@ -943,14 +944,9 @@ TRACKBAR_Refresh (TRACKBAR_INFO *infoPtr, HDC hdcDst)
/* Erase background */ /* Erase background */
if (gcdrf == CDRF_DODEFAULT || if (gcdrf == CDRF_DODEFAULT ||
notify_customdraw(infoPtr, &nmcd, CDDS_PREERASE) != CDRF_SKIPDEFAULT) { notify_customdraw(infoPtr, &nmcd, CDDS_PREERASE) != CDRF_SKIPDEFAULT) {
if (GetWindowTheme (infoPtr->hwndSelf)) { brush = (HBRUSH)SendMessageW(infoPtr->hwndNotify, WM_CTLCOLORSTATIC, (WPARAM)hdc,
DrawThemeParentBackground (infoPtr->hwndSelf, hdc, 0); (LPARAM)infoPtr->hwndSelf);
} FillRect(hdc, &rcClient, brush ? brush : GetSysColorBrush(COLOR_BTNFACE));
else {
HBRUSH brush = (HBRUSH)SendMessageW(infoPtr->hwndNotify, WM_CTLCOLORSTATIC,
(WPARAM)hdc, (LPARAM)infoPtr->hwndSelf);
FillRect (hdc, &rcClient, brush ? brush : GetSysColorBrush(COLOR_BTNFACE));
}
if (gcdrf != CDRF_DODEFAULT) if (gcdrf != CDRF_DODEFAULT)
notify_customdraw(infoPtr, &nmcd, CDDS_POSTERASE); notify_customdraw(infoPtr, &nmcd, CDDS_POSTERASE);
} }
......
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