[PATCH 5/6] user32: Separate scroll bar window checks from actual drawing.
Zhiyi Zhang
zzhang at codeweavers.com
Tue Jul 6 02:07:55 CDT 2021
Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
---
dlls/user32/scroll.c | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/dlls/user32/scroll.c b/dlls/user32/scroll.c
index 6e9f899496f..d7a4f412785 100644
--- a/dlls/user32/scroll.c
+++ b/dlls/user32/scroll.c
@@ -562,15 +562,10 @@ static void SCROLL_DoDrawScrollBar( HWND hwnd, HDC hdc, INT nBar, enum SCROLL_HI
BOOL interior, RECT *rect, INT arrowSize, INT thumbPos,
INT thumbSize, BOOL vertical )
{
- SCROLLBAR_INFO *infoPtr = SCROLL_GetInternalInfo( hwnd, nBar, TRUE );
- DWORD style = GetWindowLongW( hwnd, GWL_STYLE );
+ SCROLLBAR_INFO *infoPtr;
- if (!(hwnd = WIN_GetFullHandle( hwnd ))) return;
-
- if (!infoPtr ||
- ((nBar == SB_VERT) && !(style & WS_VSCROLL)) ||
- ((nBar == SB_HORZ) && !(style & WS_HSCROLL))) return;
- if (!WIN_IsWindowDrawable( hwnd, FALSE )) return;
+ if (!(infoPtr = SCROLL_GetInternalInfo( hwnd, nBar, TRUE )))
+ return;
/* Draw the arrows */
@@ -625,8 +620,19 @@ void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, INT bar, enum SCROLL_HITTEST hit_
{
INT arrow_size, thumb_size, thumb_pos;
BOOL vertical;
+ DWORD style;
RECT rect;
+ if (!(hwnd = WIN_GetFullHandle( hwnd )))
+ return;
+
+ style = GetWindowLongW( hwnd, GWL_STYLE );
+ if ((bar == SB_VERT && !(style & WS_VSCROLL)) || (bar == SB_HORZ && !(style & WS_HSCROLL)))
+ return;
+
+ if (!WIN_IsWindowDrawable( hwnd, FALSE ))
+ return;
+
SCROLL_GetScrollBarDrawInfo( hwnd, bar, tracking_info, &rect, &arrow_size, &thumb_size,
&thumb_pos, &vertical );
/* do not draw if the scrollbar rectangle is empty */
--
2.30.2
More information about the wine-devel
mailing list