[PATCH 3/4] comctl32/button: Invalidate on BM_SETCHECK

Nikolay Sivov nsivov at codeweavers.com
Sun Feb 11 10:19:55 CST 2018


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 dlls/comctl32/button.c       |  2 +-
 dlls/comctl32/tests/button.c | 11 +++--------
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c
index 85aa47f4bb..2f5a5b3f17 100644
--- a/dlls/comctl32/button.c
+++ b/dlls/comctl32/button.c
@@ -663,7 +663,7 @@ static LRESULT CALLBACK BUTTON_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, L
         if ((state & 3) != wParam)
         {
             set_button_state( hWnd, (state & ~3) | wParam );
-            paint_button( hWnd, btn_type, ODA_SELECT );
+            InvalidateRect( hWnd, NULL, FALSE );
         }
         if ((btn_type == BS_AUTORADIOBUTTON) && (wParam == BST_CHECKED) && (style & WS_CHILD))
             BUTTON_CheckAutoRadioButton( hWnd );
diff --git a/dlls/comctl32/tests/button.c b/dlls/comctl32/tests/button.c
index 38446aab67..96b8bea531 100644
--- a/dlls/comctl32/tests/button.c
+++ b/dlls/comctl32/tests/button.c
@@ -440,8 +440,7 @@ static const struct message setcheck_radio_redraw_seq[] =
     { WM_STYLECHANGED, sent|wparam|defwinproc, GWL_STYLE },
     { WM_APP, sent|wparam|lparam, 0, 0 },
     { WM_PAINT, sent },
-    { WM_NCPAINT, sent|optional }, /* FIXME: Wine sends it */
-    { WM_ERASEBKGND, sent|defwinproc|optional },
+    { WM_NCPAINT, sent|defwinproc|optional }, /* FIXME: Wine sends it */
     { 0 }
 };
 
@@ -661,7 +660,9 @@ static void test_button_messages(void)
         SendMessageA(hwnd, BM_SETCHECK, BST_CHECKED, 0);
         SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */
         while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
+        ok_sequence(sequences, COMBINED_SEQ_INDEX, button[i].setcheck, "BM_SETCHECK on a button", FALSE);
 
+        state = SendMessageA(hwnd, BM_GETCHECK, 0, 0);
         if (button[i].style == BS_PUSHBUTTON ||
             button[i].style == BS_DEFPUSHBUTTON ||
             button[i].style == BS_GROUPBOX ||
@@ -672,16 +673,10 @@ static void test_button_messages(void)
             button[i].style == BS_COMMANDLINK ||
             button[i].style == BS_DEFCOMMANDLINK)
         {
-            ok_sequence(sequences, COMBINED_SEQ_INDEX, button[i].setcheck, "BM_SETCHECK on a button", FALSE);
-            state = SendMessageA(hwnd, BM_GETCHECK, 0, 0);
             ok(state == BST_UNCHECKED, "expected check BST_UNCHECKED, got %04x\n", state);
         }
         else
-        {
-            ok_sequence(sequences, COMBINED_SEQ_INDEX, button[i].setcheck, "BM_SETCHECK on a button", TRUE);
-            state = SendMessageA(hwnd, BM_GETCHECK, 0, 0);
             ok(state == BST_CHECKED, "expected check BST_CHECKED, got %04x\n", state);
-        }
 
         style = GetWindowLongA(hwnd, GWL_STYLE);
         style &= ~(WS_CHILD | BS_NOTIFY | WS_VISIBLE);
-- 
2.15.1




More information about the wine-devel mailing list