mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 19:26:32 +00:00
[NTUSER] Report fresh scrollbar state in co_IntGetScrollBarInfo (#9137)
`co_IntGetScrollBarInfo()` computed the `rgstate` bits into the output buffer and then immediately overwrote them with the cached copy, so callers always got stale state. Fix this by copying the cached info before computing `rgstate`. This also exposed an inverted `WS_DISABLED` test (per wine, disabled `SB_CTL` should report `UNAVAILABLE`, not enabled ones), which is now fixed as well.
This commit is contained in:
@@ -701,6 +701,8 @@ co_IntGetScrollBarInfo(PWND Window, LONG idObject, PSCROLLBARINFO psbi)
|
||||
IntGetScrollBarRect(Window, Bar, &(sbi->rcScrollBar));
|
||||
IntCalculateThumb(Window, Bar, sbi, pSBData);
|
||||
|
||||
RtlCopyMemory(psbi, sbi, sizeof(*psbi));
|
||||
|
||||
// Scrollbar state
|
||||
psbi->rgstate[0] = 0;
|
||||
if ((Bar == SB_HORZ && !(Window->style & WS_HSCROLL))
|
||||
@@ -713,11 +715,9 @@ co_IntGetScrollBarInfo(PWND Window, LONG idObject, PSCROLLBARINFO psbi)
|
||||
else
|
||||
psbi->rgstate[0] |= STATE_SYSTEM_OFFSCREEN;
|
||||
}
|
||||
if (Bar == SB_CTL && !(Window->style & WS_DISABLED))
|
||||
if (Bar == SB_CTL && (Window->style & WS_DISABLED))
|
||||
psbi->rgstate[0] |= STATE_SYSTEM_UNAVAILABLE;
|
||||
|
||||
RtlCopyMemory(psbi, sbi, sizeof(SCROLLBARINFO));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user