Commit 523d8cee authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

user32: Make sure that focus_rect is always initialized.

parent d5f2172c
......@@ -826,15 +826,18 @@ static void PB_Paint( HWND hwnd, HDC hDC, UINT action )
hOldBrush = SelectObject(hDC,GetSysColorBrush(COLOR_BTNFACE));
oldBkMode = SetBkMode(hDC, TRANSPARENT);
/* completely skip the drawing if only focus has changed */
if (action == ODA_FOCUS) goto draw_focus;
if (get_button_type(style) == BS_DEFPUSHBUTTON)
{
Rectangle(hDC, rc.left, rc.top, rc.right, rc.bottom);
if (action != ODA_FOCUS)
Rectangle(hDC, rc.left, rc.top, rc.right, rc.bottom);
InflateRect( &rc, -1, -1 );
}
focus_rect = rc;
/* completely skip the drawing if only focus has changed */
if (action == ODA_FOCUS) goto draw_focus;
uState = DFCS_BUTTONPUSH | DFCS_ADJUSTRECT;
if (style & BS_FLAT)
......@@ -852,8 +855,6 @@ static void PB_Paint( HWND hwnd, HDC hDC, UINT action )
DrawFrameControl( hDC, &rc, DFC_BUTTON, uState );
focus_rect = rc;
/* draw button label */
r = rc;
dtFlags = BUTTON_CalcLabelRect(hwnd, hDC, &r);
......
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