https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0484beb04b8c35599e9a32fa033645d6cc57ca40

commit 0484beb04b8c35599e9a32fa033645d6cc57ca40
Author:     Katayama Hirofumi MZ <katayama.hirofumi...@gmail.com>
AuthorDate: Thu Nov 10 13:12:20 2022 +0900
Commit:     GitHub <nore...@github.com>
CommitDate: Thu Nov 10 13:12:20 2022 +0900

    [NTUSER] Don't redraw scrollbar if it is hidden (#4849)
    
    Fix redrawing bug on Command Prompt. CORE-18593
---
 win32ss/user/ntuser/scrollbar.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/win32ss/user/ntuser/scrollbar.c b/win32ss/user/ntuser/scrollbar.c
index c4a6f2f1d8b..3763ac5c494 100644
--- a/win32ss/user/ntuser/scrollbar.c
+++ b/win32ss/user/ntuser/scrollbar.c
@@ -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 */
          {

Reply via email to