Rémi Bernon : user32/tests: Wait longer for injected mouse event to take effect.

Alexandre Julliard julliard at winehq.org
Wed Nov 13 16:01:10 CST 2019


Module: wine
Branch: master
Commit: c1b8deeff003b7face44ad7524ce751e994952c6
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=c1b8deeff003b7face44ad7524ce751e994952c6

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Tue Nov 12 21:42:04 2019 +0100

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 at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 45c6787c16..dc5b0ff3ed 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -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 );
     }
 }
 




More information about the wine-cvs mailing list