user32/tests: Wait longer for injected mouse event to take effect.

Also rework the wait loop a bit, the delay was weird.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2019-11-12 21:42:04 +01:00 committed by Alexandre Julliard
parent 0779443518
commit c1b8deeff0
1 changed files with 6 additions and 6 deletions

View File

@ -12300,15 +12300,15 @@ done:
static void wait_move_event(HWND hwnd, int x, int y)
{
MSG msg;
DWORD time;
DWORD timeout = GetTickCount() + 500, delay;
BOOL ret;
time = GetTickCount();
while (GetTickCount() - time < 200) {
while ((delay = timeout - GetTickCount()) > 0)
{
ret = PeekMessageA(&msg, hwnd, WM_MOUSEMOVE, WM_MOUSEMOVE, PM_NOREMOVE);
if (ret && msg.pt.x > x && msg.pt.y > y) break;
if (!ret) MsgWaitForMultipleObjects( 0, NULL, FALSE, GetTickCount() - time, QS_ALLINPUT );
else Sleep( GetTickCount() - time );
if (!ret) MsgWaitForMultipleObjects( 0, NULL, FALSE, delay, QS_ALLINPUT );
else Sleep( delay );
}
}