user32: Make sure that focus_rect is always initialized.
This commit is contained in:
parent
d5f2172c09
commit
523d8ceefc
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue