Commit 09f43e04 authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

user32: Separate scroll bar window checks from actual drawing.

parent cead75ad
...@@ -562,15 +562,10 @@ static void SCROLL_DoDrawScrollBar( HWND hwnd, HDC hdc, INT nBar, enum SCROLL_HI ...@@ -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, BOOL interior, RECT *rect, INT arrowSize, INT thumbPos,
INT thumbSize, BOOL vertical ) INT thumbSize, BOOL vertical )
{ {
SCROLLBAR_INFO *infoPtr = SCROLL_GetInternalInfo( hwnd, nBar, TRUE ); SCROLLBAR_INFO *infoPtr;
DWORD style = GetWindowLongW( hwnd, GWL_STYLE );
if (!(hwnd = WIN_GetFullHandle( hwnd ))) return;
if (!infoPtr || if (!(infoPtr = SCROLL_GetInternalInfo( hwnd, nBar, TRUE )))
((nBar == SB_VERT) && !(style & WS_VSCROLL)) || return;
((nBar == SB_HORZ) && !(style & WS_HSCROLL))) return;
if (!WIN_IsWindowDrawable( hwnd, FALSE )) return;
/* Draw the arrows */ /* Draw the arrows */
...@@ -625,8 +620,19 @@ void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, INT bar, enum SCROLL_HITTEST hit_ ...@@ -625,8 +620,19 @@ void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, INT bar, enum SCROLL_HITTEST hit_
{ {
INT arrow_size, thumb_size, thumb_pos; INT arrow_size, thumb_size, thumb_pos;
BOOL vertical; BOOL vertical;
DWORD style;
RECT rect; 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, SCROLL_GetScrollBarDrawInfo( hwnd, bar, tracking_info, &rect, &arrow_size, &thumb_size,
&thumb_pos, &vertical ); &thumb_pos, &vertical );
/* do not draw if the scrollbar rectangle is empty */ /* do not draw if the scrollbar rectangle is empty */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment