comctl32/edit: Don't repaint immediately when losing focus.

Ignore some messages for the parent window because the "Kill focus" message sequence starts
succeeding with this commit but sometimes those messages appear on Wine and cause random test
failures. Those messages are not interested in the tests so ignore them.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
This commit is contained in:
Zhiyi Zhang 2022-08-12 11:32:54 +08:00 committed by Alexandre Julliard
parent a336b43a93
commit e2a725621a
2 changed files with 7 additions and 3 deletions

View file

@ -3402,7 +3402,7 @@ static LRESULT EDIT_WM_KeyDown(EDITSTATE *es, INT key)
*/
static LRESULT EDIT_WM_KillFocus(HTHEME theme, EDITSTATE *es)
{
UINT flags = RDW_INVALIDATE | RDW_UPDATENOW;
UINT flags = RDW_INVALIDATE;
es->flags &= ~EF_FOCUSED;
DestroyCaret();

View file

@ -900,6 +900,10 @@ static LRESULT CALLBACK parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam,
message != WM_GETMINMAXINFO &&
message != WM_PAINT &&
message != WM_CTLCOLOREDIT &&
message != WM_WINDOWPOSCHANGING &&
message != WM_WINDOWPOSCHANGED &&
message != WM_MOVE &&
message != WM_MOUSEACTIVATE &&
message < 0xc000)
{
add_message(sequences, COMBINED_SEQ_INDEX, &msg);
@ -3451,7 +3455,7 @@ static void test_change_focus(void)
flush_sequences(sequences, NUM_MSG_SEQUENCES);
SetFocus(parent_wnd);
while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
ok_sequence(sequences, COMBINED_SEQ_INDEX, killfocus_combined_seq, "Kill focus", TRUE);
ok_sequence(sequences, COMBINED_SEQ_INDEX, killfocus_combined_seq, "Kill focus", FALSE);
/* Test message sequences without waiting for posted messages */
SetFocus(parent_wnd);
@ -3463,7 +3467,7 @@ static void test_change_focus(void)
flush_sequences(sequences, NUM_MSG_SEQUENCES);
SetFocus(parent_wnd);
ok_sequence(sequences, COMBINED_SEQ_INDEX, killfocus_sent_only_combined_seq,
"Kill focus sent only", TRUE);
"Kill focus sent only", FALSE);
SetCursorPos(orig_pos.x, orig_pos.y);