diff --git a/win32ss/user/ntuser/scrollbar.c b/win32ss/user/ntuser/scrollbar.c index e4e0ba436a..b377c34b72 100644 --- a/win32ss/user/ntuser/scrollbar.c +++ b/win32ss/user/ntuser/scrollbar.c @@ -492,11 +492,33 @@ co_IntSetScrollInfo(PWND Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bRedraw) BOOL bChangeParams = FALSE; /* Don't show/hide scrollbar if params don't change */ UINT MaxPage; int MaxPos; + BOOL CurrentThemeActive; /* [0] = SB_HORZ, [1] = SB_VERT, [2] = SB_CTL */ static PWND PrevHwnd[3] = { 0 }; static DWORD PrevPos[3] = { 0 }; static DWORD PrevMax[3] = { 0 }; static INT PrevAction[3] = { 0 }; + static BOOL ThemeActive; + static INT ThemeCount = 0; + + /* This handles an anomaly that SIF_THEMED goes to 0 incorrectly + * on an intermittent basis but never for more than 2 or 3 times + * in a row when an actual theme is in use */ + CurrentThemeActive = !!(lpsi->fMask & SIF_THEMED); + if (ThemeActive && !CurrentThemeActive) + { + ThemeCount++; + if (ThemeCount > 4) + { + ThemeActive = FALSE; + ThemeCount = 0; + } + } + else + { + ThemeActive = CurrentThemeActive; + ThemeCount = 0; + } ASSERT_REFS_CO(Window); @@ -660,7 +682,7 @@ co_IntSetScrollInfo(PWND Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bRedraw) return lpsi->fMask & SIF_PREVIOUSPOS ? OldPos : pSBData->pos; /* SetWindowPos() already did the painting */ if (bRedraw) { - if (!(lpsi->fMask & SIF_THEMED)) /* Not Using Themes */ + if (!ThemeActive) { TRACE("Not using themes.\n"); if (action & SA_SSI_REPAINT_ARROWS)