Also rework the wait loop a bit, the delay was weird.
https://testbot.winehq.org/JobDetails.pl?Key=59890#k112
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/user32/tests/msg.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 593a1e65047..24314e98eb4 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -12309,15 +12309,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 ); } }