[NTUSER] Don't redraw scrollbar if it is hidden (#4849)

Fix redrawing bug on Command Prompt. CORE-18593
This commit is contained in:
Katayama Hirofumi MZ 2022-11-10 13:12:20 +09:00 committed by GitHub
parent 3fc6d90c58
commit 0484beb04b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -497,6 +497,7 @@ co_IntSetScrollInfo(PWND Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bRedraw)
static DWORD PrevPos[3] = { 0 };
static DWORD PrevMax[3] = { 0 };
static INT PrevAction[3] = { 0 };
BOOL bVisible;
ASSERT_REFS_CO(Window);
@ -663,7 +664,24 @@ co_IntSetScrollInfo(PWND Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bRedraw)
if ( action & SA_SSI_SHOW )
if ( co_UserShowScrollBar(Window, nBar, TRUE, TRUE) )
return lpsi->fMask & SIF_PREVIOUSPOS ? OldPos : pSBData->pos; /* SetWindowPos() already did the painting */
if (bRedraw)
switch (nBar)
{
case SB_HORZ:
bVisible = (Window->style & WS_HSCROLL);
break;
case SB_VERT:
bVisible = (Window->style & WS_VSCROLL);
break;
case SB_CTL:
bVisible = (Window->style & WS_VISIBLE);
break;
default:
bVisible = FALSE;
break;
}
if (bRedraw && bVisible)
{
if (!(Info->fMask & SIF_THEMED)) /* Not Using Themes */
{