Module: wine Branch: oldstable Commit: 006186743f7d8420d73f6deda24741bed9fa7a40 URL: https://source.winehq.org/git/wine.git/?a=commit;h=006186743f7d8420d73f6deda...
Author: Dmitry Timoshkov dmitry@baikal.ru Date: Sun Nov 25 20:58:00 2018 +0300
user32: Move the auto radio button group logic from BM_SETCHECK to WM_LBUTTONUP handler.
This patch also changes the logic to get the control style with WM_GETDLGCODE instead of GetWindowLong to make the message test pass.
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru Signed-off-by: Alexandre Julliard julliard@winehq.org (cherry picked from commit 96d0af52eb0d14084397647b974c5efebb59d0f0) Signed-off-by: Michael Stefaniuc mstefani@winehq.org
---
dlls/user32/button.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/dlls/user32/button.c b/dlls/user32/button.c index e5cee12..2082295 100644 --- a/dlls/user32/button.c +++ b/dlls/user32/button.c @@ -334,7 +334,7 @@ LRESULT ButtonWndProc_common(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, SendMessageW( hWnd, BM_SETCHECK, !(state & BST_CHECKED), 0 ); break; case BS_AUTORADIOBUTTON: - SendMessageW( hWnd, BM_SETCHECK, TRUE, 0 ); + BUTTON_CheckAutoRadioButton( hWnd ); break; case BS_AUTO3STATE: SendMessageW( hWnd, BM_SETCHECK, @@ -500,8 +500,6 @@ LRESULT ButtonWndProc_common(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, set_button_state( hWnd, (state & ~3) | wParam ); paint_button( hWnd, btn_type, ODA_SELECT ); } - if ((btn_type == BS_AUTORADIOBUTTON) && (wParam == BST_CHECKED) && (style & WS_CHILD)) - BUTTON_CheckAutoRadioButton( hWnd ); break;
case BM_GETSTATE: @@ -986,13 +984,12 @@ static void BUTTON_CheckAutoRadioButton( HWND hwnd )
parent = GetParent(hwnd); /* make sure that starting control is not disabled or invisible */ - start = sibling = GetNextDlgGroupItem( parent, hwnd, TRUE ); + start = sibling = hwnd; do { if (!sibling) break; - if ((hwnd != sibling) && - ((GetWindowLongW( sibling, GWL_STYLE) & BS_TYPEMASK) == BS_AUTORADIOBUTTON)) - SendMessageW( sibling, BM_SETCHECK, BST_UNCHECKED, 0 ); + if (SendMessageW( sibling, WM_GETDLGCODE, 0, 0 ) == (DLGC_BUTTON | DLGC_RADIOBUTTON)) + SendMessageW( sibling, BM_SETCHECK, sibling == hwnd ? BST_CHECKED : BST_UNCHECKED, 0 ); sibling = GetNextDlgGroupItem( parent, sibling, FALSE ); } while (sibling != start); }