user32: Make sure that focus_rect is always initialized.

This commit is contained in:
Dmitry Timoshkov 2009-10-12 17:20:40 +09:00 committed by Alexandre Julliard
parent d5f2172c09
commit 523d8ceefc
1 changed files with 7 additions and 6 deletions

View File

@ -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)
{
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);