Nikolay Sivov : comctl32/button: Invalidate on BM_SETCHECK.
Alexandre Julliard
julliard at winehq.org
Mon Feb 12 16:10:36 CST 2018
Module: wine
Branch: master
Commit: 287c5a25b6ea35830bcb4b21b2a2adb8e2853232
URL: https://source.winehq.org/git/wine.git/?a=commit;h=287c5a25b6ea35830bcb4b21b2a2adb8e2853232
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Sun Feb 11 19:19:55 2018 +0300
comctl32/button: Invalidate on BM_SETCHECK.
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
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 85aa47f..2f5a5b3 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 38446aa..96b8bea 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);
More information about the wine-cvs
mailing list