[PATCH 11/12] user32/tests: Wait longer for injected mouse event to take effect.
Rémi Bernon
rbernon at codeweavers.com
Tue Nov 12 14:42:04 CST 2019
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 at 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 );
}
}
--
2.24.0.rc2
More information about the wine-devel
mailing list