diff --git a/win32ss/user/ntuser/scrollbar.c b/win32ss/user/ntuser/scrollbar.c index 52d5f38c37..ebc4db1c08 100644 --- a/win32ss/user/ntuser/scrollbar.c +++ b/win32ss/user/ntuser/scrollbar.c @@ -492,13 +492,15 @@ 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; - /* [0] = HORZ, [1] = VERT */ - static PWND PrevHwnd[2] = { 0 }; - static DWORD PrevPos[2] = { 0 }; + /* [0] = HORZ, [1] = VERT, [2] = CTL */ + static PWND PrevHwnd[3] = { 0 }; + static DWORD PrevPos[3] = { 0 }; + static DWORD PrevMax[3] = { 0 }; + static INT PrevAction[3] = { 0 }; ASSERT_REFS_CO(Window); - if(!SBID_IS_VALID(nBar)) + if(!SBID_IS_VALID(nBar)) /* Assures nBar is 0, 1, or 2 */ { EngSetLastError(ERROR_INVALID_PARAMETER); ERR("Trying to set scrollinfo for unknown scrollbar type %d", nBar); @@ -637,6 +639,16 @@ co_IntSetScrollInfo(PWND Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bRedraw) } //done: + if ((Window != PrevHwnd[nBar]) || (action != PrevAction[nBar])) + { + if ((action == SA_SSI_SHOW) && (PrevAction[nBar] == SA_SSI_HIDE)) + { + co_UserShowScrollBar(Window, nBar, TRUE, TRUE); + } + } + if ((action != PrevAction[nBar]) && action != 0) + PrevAction[nBar] = action; + if ( action & SA_SSI_HIDE ) { co_UserShowScrollBar(Window, nBar, FALSE, FALSE); @@ -690,12 +702,14 @@ co_IntSetScrollInfo(PWND Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bRedraw) } } CurrentPos = lpsi->fMask & SIF_PREVIOUSPOS ? OldPos : pSBData->pos; - /* Check for changes to Window or CurrentPos */ - if ((Window != PrevHwnd[nBar]) || (CurrentPos != PrevPos[nBar])) + /* Check for changes to Window or CurrentPos or lpsi->nMax */ + if ((Window != PrevHwnd[nBar]) || (CurrentPos != PrevPos[nBar]) || + (lpsi->nMax != PrevMax[nBar])) { co_UserRedrawWindow(Window, &UpdateRect, 0, RDW_INVALIDATE | RDW_FRAME); PrevHwnd[nBar] = Window; PrevPos[nBar] = CurrentPos; + PrevMax[nBar] = lpsi->nMax; } } } // FIXME: Arrows