From 3dcff4de701bc08845f1945a9b8efd3c4a1aedad Mon Sep 17 00:00:00 2001 From: Sven Baars Date: Mon, 7 Oct 2019 11:19:40 +0200 Subject: [PATCH] comctl32/tests: Prevent some test failures by moving the cursor away from the window. Signed-off-by: Sven Baars Signed-off-by: Alexandre Julliard --- dlls/comctl32/tests/edit.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dlls/comctl32/tests/edit.c b/dlls/comctl32/tests/edit.c index f454434a0cc..6013cafb59d 100644 --- a/dlls/comctl32/tests/edit.c +++ b/dlls/comctl32/tests/edit.c @@ -3315,6 +3315,9 @@ static void test_change_focus(void) HWND hwnd, parent_wnd; WNDPROC oldproc; MSG msg; + POINT orig_pos; + + GetCursorPos(&orig_pos); parent_wnd = CreateWindowA("ParentWnd", "", WS_OVERLAPPEDWINDOW, 0, 0, 200, 200, NULL, NULL, GetModuleHandleA(NULL), NULL); @@ -3329,6 +3332,8 @@ static void test_change_focus(void) oldproc = (WNDPROC)SetWindowLongPtrA(hwnd, GWLP_WNDPROC, (LONG_PTR)edit_subclass_proc); SetWindowLongPtrA(hwnd, GWLP_USERDATA, (LONG_PTR)oldproc); + SetCursorPos(400, 400); + SetFocus(parent_wnd); flush_sequences(sequences, NUM_MSG_SEQUENCES); SetFocus(hwnd); @@ -3340,6 +3345,8 @@ static void test_change_focus(void) while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); ok_sequence(sequences, COMBINED_SEQ_INDEX, killfocus_combined_seq, "Kill focus", TRUE); + SetCursorPos(orig_pos.x, orig_pos.y); + DestroyWindow(hwnd); }