From: Zhiyi Zhang zzhang@codeweavers.com
This is confirmed by the tests in test_scrollbar() and manual tests on XP. Even though scrollbar arrows and thumb are in fact transparent, DrawThemeParentBackground() is not called to paint the parent background, leaving the transparent area untouched. On Windows, even if the scrollbar arrows are reported to be transparent, the bitmaps for arrow parts in the stock themes are in fact opaque.
Fix Ice Cream Calculator slow scrolling after 4cb229a because the WM_PRINTCLIENT handling in the application is slow.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53337 --- dlls/uxtheme/scrollbar.c | 14 -------------- dlls/uxtheme/tests/system.c | 2 +- 2 files changed, 1 insertion(+), 15 deletions(-)
diff --git a/dlls/uxtheme/scrollbar.c b/dlls/uxtheme/scrollbar.c index 1f1c61d74e1..d5735c5279a 100644 --- a/dlls/uxtheme/scrollbar.c +++ b/dlls/uxtheme/scrollbar.c @@ -138,14 +138,10 @@ void WINAPI UXTHEME_ScrollBarDraw(HWND hwnd, HDC dc, INT bar, enum SCROLL_HITTES
partrect = *rect; partrect.bottom = partrect.top + arrowsize; - if (bar == SB_CTL && IsThemeBackgroundPartiallyTransparent(theme, SBP_ARROWBTN, uparrowstate)) - DrawThemeParentBackground(hwnd, dc, &partrect); DrawThemeBackground(theme, dc, SBP_ARROWBTN, uparrowstate, &partrect, NULL);
partrect.bottom = rect->bottom; partrect.top = partrect.bottom - arrowsize; - if (bar == SB_CTL && IsThemeBackgroundPartiallyTransparent(theme, SBP_ARROWBTN, downarrowstate)) - DrawThemeParentBackground(hwnd, dc, &partrect); DrawThemeBackground(theme, dc, SBP_ARROWBTN, downarrowstate, &partrect, NULL);
if (thumbpos > 0) { @@ -161,9 +157,6 @@ void WINAPI UXTHEME_ScrollBarDraw(HWND hwnd, HDC dc, INT bar, enum SCROLL_HITTES if (thumbsize > 0) { partrect.top = rect->top + thumbpos; partrect.bottom = partrect.top + thumbsize; - - if (bar == SB_CTL && IsThemeBackgroundPartiallyTransparent(theme, SBP_THUMBBTNVERT, thumbstate)) - DrawThemeParentBackground(hwnd, dc, &partrect); DrawThemeBackground(theme, dc, SBP_THUMBBTNVERT, thumbstate, &partrect, NULL);
if (SUCCEEDED(GetThemePartSize(theme, dc, SBP_GRIPPERVERT, thumbstate, NULL, TS_DRAW, &grippersize))) { @@ -217,14 +210,10 @@ void WINAPI UXTHEME_ScrollBarDraw(HWND hwnd, HDC dc, INT bar, enum SCROLL_HITTES
partrect = *rect; partrect.right = partrect.left + arrowsize; - if (bar == SB_CTL && IsThemeBackgroundPartiallyTransparent(theme, SBP_ARROWBTN, leftarrowstate)) - DrawThemeParentBackground(hwnd, dc, &partrect); DrawThemeBackground(theme, dc, SBP_ARROWBTN, leftarrowstate, &partrect, NULL);
partrect.right = rect->right; partrect.left = partrect.right - arrowsize; - if (bar == SB_CTL && IsThemeBackgroundPartiallyTransparent(theme, SBP_ARROWBTN, rightarrowstate)) - DrawThemeParentBackground(hwnd, dc, &partrect); DrawThemeBackground(theme, dc, SBP_ARROWBTN, rightarrowstate, &partrect, NULL);
if (thumbpos > 0) { @@ -240,9 +229,6 @@ void WINAPI UXTHEME_ScrollBarDraw(HWND hwnd, HDC dc, INT bar, enum SCROLL_HITTES if (thumbsize > 0) { partrect.left = rect->left + thumbpos; partrect.right = partrect.left + thumbsize; - - if (bar == SB_CTL && IsThemeBackgroundPartiallyTransparent(theme, SBP_THUMBBTNHORZ, thumbstate)) - DrawThemeParentBackground(hwnd, dc, &partrect); DrawThemeBackground(theme, dc, SBP_THUMBBTNHORZ, thumbstate, &partrect, NULL);
if (SUCCEEDED(GetThemePartSize(theme, dc, SBP_GRIPPERHORZ, thumbstate, NULL, TS_DRAW, &grippersize))) { diff --git a/dlls/uxtheme/tests/system.c b/dlls/uxtheme/tests/system.c index 71928ca4670..1f004e5c5dd 100644 --- a/dlls/uxtheme/tests/system.c +++ b/dlls/uxtheme/tests/system.c @@ -2660,7 +2660,7 @@ static void test_scrollbar(void) * If DrawThemeParentBackground() is called then WM_PRINTCLIENT must be present */ RedrawWindow(child, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_ERASENOW | RDW_FRAME); ok_sequence(sequences, PARENT_SEQ_INDEX, wm_ctlcolorscrollbar_seq, "SB_CTL scrollbar paint", - IsThemeActive()); + FALSE);
hdc = GetDC(child); color = GetPixel(hdc, 10, 10);