https://git.reactos.org/?p=reactos.git;a=commitdiff;h=19fbdda95cb972f5d6f96…
commit 19fbdda95cb972f5d6f9652c238a2edc056538f3
Author: Joachim Henze <Joachim.Henze(a)reactos.org>
AuthorDate: Sat Nov 9 15:50:10 2019 +0100
Commit: Joachim Henze <Joachim.Henze(a)reactos.org>
CommitDate: Sat Nov 9 15:50:50 2019 +0100
[WIN32SS] Prevent disabled scrollbars being clickable CORE-15557
Thanks to JIRA user 'I_Kill_Bugs.
VBox:
https://reactos.org/testman/compare.php?ids=69671,69747
KVM:
https://reactos.org/testman/compare.php?ids=69672,69748
---
win32ss/user/user32/controls/scrollbar.c | 25 ++++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/win32ss/user/user32/controls/scrollbar.c
b/win32ss/user/user32/controls/scrollbar.c
index 3eb02429610..1e1249e296c 100644
--- a/win32ss/user/user32/controls/scrollbar.c
+++ b/win32ss/user/user32/controls/scrollbar.c
@@ -831,9 +831,13 @@ IntScrollHandleScrollEvent(HWND Wnd, INT SBType, UINT Msg, POINT Pt)
PrevPt = Pt;
if (SBType == SB_CTL && (GetWindowLongPtrW(Wnd, GWL_STYLE) &
WS_TABSTOP)) SetFocus(Wnd);
SetCapture(Wnd);
- ScrollBarInfo.rgstate[ScrollTrackHitTest] |= STATE_SYSTEM_PRESSED;
- NewInfo.rgstate[ScrollTrackHitTest] = ScrollBarInfo.rgstate[ScrollTrackHitTest];
- NtUserSetScrollBarInfo(Wnd, IntScrollGetObjectId(SBType), &NewInfo);
+ /* Don't update scrollbar if disabled. */
+ if (ScrollBarInfo.rgstate[ScrollTrackHitTest] != STATE_SYSTEM_UNAVAILABLE)
+ {
+ ScrollBarInfo.rgstate[ScrollTrackHitTest] |= STATE_SYSTEM_PRESSED;
+ NewInfo.rgstate[ScrollTrackHitTest] =
ScrollBarInfo.rgstate[ScrollTrackHitTest];
+ NtUserSetScrollBarInfo(Wnd, IntScrollGetObjectId(SBType), &NewInfo);
+ }
break;
case WM_MOUSEMOVE:
@@ -846,13 +850,16 @@ IntScrollHandleScrollEvent(HWND Wnd, INT SBType, UINT Msg, POINT
Pt)
ReleaseCapture();
/* if scrollbar has focus, show back caret */
if (Wnd == GetFocus()) ShowCaret(Wnd);
- ScrollBarInfo.rgstate[ScrollTrackHitTest] &= ~STATE_SYSTEM_PRESSED;
- NewInfo.rgstate[ScrollTrackHitTest] = ScrollBarInfo.rgstate[ScrollTrackHitTest];
- NtUserSetScrollBarInfo(Wnd, IntScrollGetObjectId(SBType), &NewInfo);
-
- IntDrawScrollInterior(Wnd,Dc,SBType,Vertical,&ScrollBarInfo);
- IntDrawScrollArrows(Dc, &ScrollBarInfo, Vertical);
+ /* Don't update scrollbar if disabled. */
+ if (ScrollBarInfo.rgstate[ScrollTrackHitTest] != STATE_SYSTEM_UNAVAILABLE)
+ {
+ ScrollBarInfo.rgstate[ScrollTrackHitTest] &= ~STATE_SYSTEM_PRESSED;
+ NewInfo.rgstate[ScrollTrackHitTest] =
ScrollBarInfo.rgstate[ScrollTrackHitTest];
+ NtUserSetScrollBarInfo(Wnd, IntScrollGetObjectId(SBType), &NewInfo);
+ IntDrawScrollInterior(Wnd,Dc,SBType,Vertical,&ScrollBarInfo);
+ IntDrawScrollArrows(Dc, &ScrollBarInfo, Vertical);
+ }
break;
case WM_SYSTIMER: