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:
parent
0779443518
commit
c1b8deeff0
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue