Commit c1b8deef authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

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: 's avatarRémi Bernon <rbernon@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 07794435
......@@ -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) {
ret = PeekMessageA(&msg, hwnd, WM_MOUSEMOVE, WM_MOUSEMOVE, PM_NOREMOVE);
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 );
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment