From b9c882a127d2e71160295fc91aad09c90c179bc0 Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Wed, 31 Aug 2022 22:01:51 +0800 Subject: [PATCH] uxtheme: Do not draw parent background even if scrollbar arrows and thumb are transparent. 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/comctl32/tests/misc.c | 2 +- dlls/uxtheme/scrollbar.c | 14 -------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/dlls/comctl32/tests/misc.c b/dlls/comctl32/tests/misc.c index 9f6eb611388..ac4c3abaf30 100644 --- a/dlls/comctl32/tests/misc.c +++ b/dlls/comctl32/tests/misc.c @@ -887,7 +887,7 @@ static void test_themed_background(void) {TRACKBAR_CLASSA, 0, wm_ctlcolorstatic_seq}, {WC_TREEVIEWA, 0, treeview_seq}, {UPDOWN_CLASSA, 0, empty_seq}, - {WC_SCROLLBARA, 0, scrollbar_seq, TRUE}, + {WC_SCROLLBARA, 0, scrollbar_seq}, {WC_SCROLLBARA, SBS_SIZEBOX, empty_seq}, {WC_SCROLLBARA, SBS_SIZEGRIP, empty_seq}, /* Scrollbars in non-client area */ 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))) { -- 2.11.4.GIT