Module: wine Branch: master Commit: 523d8ceefc084081cb7a30af67918e4bac8c7454 URL: http://source.winehq.org/git/wine.git/?a=commit;h=523d8ceefc084081cb7a30af67...
Author: Dmitry Timoshkov dmitry@codeweavers.com Date: Mon Oct 12 17:20:40 2009 +0900
user32: Make sure that focus_rect is always initialized.
---
dlls/user32/button.c | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/dlls/user32/button.c b/dlls/user32/button.c index 1681949..fbe4c82 100644 --- a/dlls/user32/button.c +++ b/dlls/user32/button.c @@ -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);