[NTUSER] Improve Themed Scrollbars by Minimizing Updates (#3953)

This fixes regressions CORE-17754 and CORE-17755 which regressed by
0.4.15-dev-3086-g 236649c626
This commit is contained in:
Doug Lyons 2021-09-12 15:54:46 -05:00 committed by GitHub
parent 6e9ff14e26
commit 3bf7e3ac13
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -488,10 +488,13 @@ co_IntSetScrollInfo(PWND Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bRedraw)
UINT new_flags; UINT new_flags;
INT action = 0; INT action = 0;
PSBDATA pSBData; PSBDATA pSBData;
DWORD OldPos = 0; DWORD OldPos = 0, CurrentPos = 0;
BOOL bChangeParams = FALSE; /* Don't show/hide scrollbar if params don't change */ BOOL bChangeParams = FALSE; /* Don't show/hide scrollbar if params don't change */
UINT MaxPage; UINT MaxPage;
int MaxPos; int MaxPos;
/* [0] = HORZ, [1] = VERT */
static PWND PrevHwnd[2] = { 0 };
static DWORD PrevPos[2] = { 0 };
ASSERT_REFS_CO(Window); ASSERT_REFS_CO(Window);
@ -686,7 +689,14 @@ co_IntSetScrollInfo(PWND Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bRedraw)
UpdateRect.bottom -= psbi->dxyLineButton; UpdateRect.bottom -= psbi->dxyLineButton;
} }
} }
co_UserRedrawWindow(Window, &UpdateRect, 0, RDW_INVALIDATE | RDW_FRAME); CurrentPos = lpsi->fMask & SIF_PREVIOUSPOS ? OldPos : pSBData->pos;
/* Check for changes to Window or CurrentPos */
if ((Window != PrevHwnd[nBar]) || (CurrentPos != PrevPos[nBar]))
{
co_UserRedrawWindow(Window, &UpdateRect, 0, RDW_INVALIDATE | RDW_FRAME);
PrevHwnd[nBar] = Window;
PrevPos[nBar] = CurrentPos;
}
} }
} // FIXME: Arrows } // FIXME: Arrows
/* else if( action & SA_SSI_REPAINT_ARROWS ) /* else if( action & SA_SSI_REPAINT_ARROWS )