Dmitry Timoshkov : comctl32: Always call BeginPaint/ EndPaint when handling a WM_PAINT message for the button.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Oct 20 11:28:31 CDT 2015


Module: wine
Branch: master
Commit: 59cca65ce0edd88b65a55a847468761e11dfab0b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=59cca65ce0edd88b65a55a847468761e11dfab0b

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Tue Oct 20 21:56:15 2015 +0800

comctl32: Always call BeginPaint/EndPaint when handling a WM_PAINT message for the button.

Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/comctl32/theme_button.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/dlls/comctl32/theme_button.c b/dlls/comctl32/theme_button.c
index 327c76b..edb31e6 100644
--- a/dlls/comctl32/theme_button.c
+++ b/dlls/comctl32/theme_button.c
@@ -319,9 +319,6 @@ static BOOL BUTTON_Paint(HTHEME theme, HWND hwnd, HDC hParamDC)
     ButtonState drawState;
     pfThemedPaint paint = btnThemedPaintFunc[ dwStyle & BUTTON_TYPE ];
 
-    if(!paint)
-        return FALSE;
-
     if(IsWindowEnabled(hwnd))
     {
         if(state & BST_PUSHED) drawState = STATE_PRESSED;
@@ -332,7 +329,7 @@ static BOOL BUTTON_Paint(HTHEME theme, HWND hwnd, HDC hParamDC)
     else drawState = STATE_DISABLED;
 
     hDC = hParamDC ? hParamDC : BeginPaint(hwnd, &ps);
-    paint(theme, hwnd, hDC, drawState, dtFlags, state & BST_FOCUS);
+    if (paint) paint(theme, hwnd, hDC, drawState, dtFlags, state & BST_FOCUS);
     if (!hParamDC) EndPaint(hwnd, &ps);
     return TRUE;
 }




More information about the wine-cvs mailing list