forked from Mirrors/wine-wine
comctl32/button: Do not set BS_PUSHBUTTON and BS_DEFPUSHBUTTON style directly to Split Buttons and Command Links.
For Split Buttons and Command Links of common control version 6, setting BS_PUSHBUTTON and BS_DEFPUSHBUTTON style toggles their default bit. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47621 Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>feature/deterministic
parent
01fbe20617
commit
463482a829
|
@ -847,8 +847,14 @@ static LRESULT CALLBACK BUTTON_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, L
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BM_SETSTYLE:
|
case BM_SETSTYLE:
|
||||||
btn_type = wParam & BS_TYPEMASK;
|
{
|
||||||
style = (style & ~BS_TYPEMASK) | btn_type;
|
DWORD new_btn_type;
|
||||||
|
|
||||||
|
new_btn_type= wParam & BS_TYPEMASK;
|
||||||
|
if (btn_type >= BS_SPLITBUTTON && new_btn_type <= BS_DEFPUSHBUTTON)
|
||||||
|
new_btn_type = (btn_type & ~BS_DEFPUSHBUTTON) | new_btn_type;
|
||||||
|
|
||||||
|
style = (style & ~BS_TYPEMASK) | new_btn_type;
|
||||||
SetWindowLongW( hWnd, GWL_STYLE, style );
|
SetWindowLongW( hWnd, GWL_STYLE, style );
|
||||||
|
|
||||||
/* Only redraw if lParam flag is set.*/
|
/* Only redraw if lParam flag is set.*/
|
||||||
|
@ -856,7 +862,7 @@ static LRESULT CALLBACK BUTTON_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, L
|
||||||
InvalidateRect( hWnd, NULL, TRUE );
|
InvalidateRect( hWnd, NULL, TRUE );
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case BM_CLICK:
|
case BM_CLICK:
|
||||||
SendMessageW( hWnd, WM_LBUTTONDOWN, 0, 0 );
|
SendMessageW( hWnd, WM_LBUTTONDOWN, 0, 0 );
|
||||||
SendMessageW( hWnd, WM_LBUTTONUP, 0, 0 );
|
SendMessageW( hWnd, WM_LBUTTONUP, 0, 0 );
|
||||||
|
|
|
@ -2303,7 +2303,6 @@ static void test_style(void)
|
||||||
else
|
else
|
||||||
expected_type = j;
|
expected_type = j;
|
||||||
|
|
||||||
todo_wine_if(i >= BS_SPLITBUTTON && j <= BS_DEFPUSHBUTTON)
|
|
||||||
ok(type == expected_type || broken(type == j), /* XP */
|
ok(type == expected_type || broken(type == j), /* XP */
|
||||||
"Original type %#x, expected new type %#x, got %#x.\n", i, expected_type, type);
|
"Original type %#x, expected new type %#x, got %#x.\n", i, expected_type, type);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue