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

Alexandre Julliard julliard at wine.codeweavers.com
Mon Oct 19 11:34:20 CDT 2015


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

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Mon Oct 19 20:16:50 2015 +0800

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

Python 3.5 installer creates windows with class "Button" that have 0x000e
button style, that causes infinite painting loops and inability to draw
the installer UI.

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

---

 dlls/user32/button.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/dlls/user32/button.c b/dlls/user32/button.c
index 9a10b86..eeb3035 100644
--- a/dlls/user32/button.c
+++ b/dlls/user32/button.c
@@ -282,16 +282,18 @@ LRESULT ButtonWndProc_common(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
 
     case WM_PRINTCLIENT:
     case WM_PAINT:
+    {
+        PAINTSTRUCT ps;
+        HDC hdc = wParam ? (HDC)wParam : BeginPaint( hWnd, &ps );
         if (btnPaintFunc[btn_type])
         {
-            PAINTSTRUCT ps;
-            HDC hdc = wParam ? (HDC)wParam : BeginPaint( hWnd, &ps );
             int nOldMode = SetBkMode( hdc, OPAQUE );
             (btnPaintFunc[btn_type])( hWnd, hdc, ODA_DRAWENTIRE );
             SetBkMode(hdc, nOldMode); /*  reset painting mode */
-            if( !wParam ) EndPaint( hWnd, &ps );
         }
+        if ( !wParam ) EndPaint( hWnd, &ps );
         break;
+    }
 
     case WM_KEYDOWN:
 	if (wParam == VK_SPACE)




More information about the wine-cvs mailing list