user32: Modify SCROLL_MovingThumb outside of SCROLL_DrawMovingThumb().

SCROLL_MovingThumb is a global variable. Gradually move it out of scroll bar drawing functions so
that those drawing functions can be refactored in a way that doesn't need access to global variables.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zhiyi Zhang 2021-07-05 20:31:13 +08:00 committed by Alexandre Julliard
parent d164f06279
commit ac6817de54
1 changed files with 4 additions and 2 deletions

View File

@ -484,8 +484,6 @@ static void SCROLL_DrawMovingThumb( HDC hdc, RECT *rect, BOOL vertical,
SCROLL_DrawInterior( SCROLL_TrackingWin, hdc, SCROLL_TrackingBar, rect, arrowSize, thumbSize, pos,
0, vertical, FALSE, FALSE );
SCROLL_MovingThumb = !SCROLL_MovingThumb;
}
/***********************************************************************
@ -625,6 +623,7 @@ void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, INT nBar,
if (SCROLL_MovingThumb && SCROLL_TrackingWin == hwnd && SCROLL_TrackingBar == nBar)
{
SCROLL_DrawMovingThumb( hdc, &rect, vertical, arrowSize, thumbSize );
SCROLL_MovingThumb = FALSE;
}
else
{
@ -867,7 +866,10 @@ static void SCROLL_HandleScrollEvent( HWND hwnd, INT nBar, UINT msg, POINT pt)
vertical,
SCROLL_TrackingPos );
if (!SCROLL_MovingThumb)
{
SCROLL_DrawMovingThumb(hdc, &rect, vertical, arrowSize, thumbSize);
SCROLL_MovingThumb = TRUE;
}
}
else if (msg == WM_LBUTTONUP)
{