comctl32/button: Improve repainting on WM_SETFOCUS.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2019-04-23 12:20:47 +03:00 committed by Alexandre Julliard
parent 9ed363a1fe
commit a058c72b0a
2 changed files with 7 additions and 3 deletions

View File

@ -815,7 +815,12 @@ static LRESULT CALLBACK BUTTON_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, L
case WM_SETFOCUS:
TRACE("WM_SETFOCUS %p\n",hWnd);
infoPtr->state |= BST_FOCUS;
if (btn_type == BS_OWNERDRAW)
paint_button( infoPtr, btn_type, ODA_FOCUS );
else
InvalidateRect(hWnd, NULL, FALSE);
if (style & BS_NOTIFY)
BUTTON_NOTIFY_PARENT(hWnd, BN_SETFOCUS);
break;

View File

@ -782,12 +782,11 @@ static void test_button_messages(void)
set_test_cd_ret(CDRF_DODEFAULT);
set_test_cd_state(CDIS_FOCUS);
todo = button[i].style != BS_OWNERDRAW;
ok(GetFocus() == 0, "expected focus 0, got %p\n", GetFocus());
SetFocus(hwnd);
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].setfocus, "SetFocus(hwnd) on a button", todo);
ok_sequence(sequences, COMBINED_SEQ_INDEX, button[i].setfocus, "SetFocus(hwnd) on a button", FALSE);
check_cd_seq(cd_setfocus_type, "SetFocus(hwnd)");
set_test_cd_state(0);