user32/tests: Make the initial timeout longer in flush_events() for machines with slower round-trip times.

This commit is contained in:
Alexandre Julliard 2008-03-05 16:48:04 +01:00
parent de928a09ec
commit d6a17d2c93
3 changed files with 10 additions and 4 deletions

View File

@ -45,13 +45,15 @@ static void flush_events(void)
{
MSG msg;
int diff = default_timeout;
int min_timeout = 50;
DWORD time = GetTickCount() + diff;
while (diff > 0)
{
if (MsgWaitForMultipleObjects( 0, NULL, FALSE, min(10,diff), QS_ALLINPUT ) == WAIT_TIMEOUT) break;
if (MsgWaitForMultipleObjects( 0, NULL, FALSE, min_timeout, QS_ALLINPUT ) == WAIT_TIMEOUT) break;
while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg );
diff = time - GetTickCount();
min_timeout = 10;
}
}

View File

@ -1543,14 +1543,16 @@ static void add_message(const struct message *msg)
static void flush_events(void)
{
MSG msg;
int diff = 100;
int diff = 200;
int min_timeout = 50;
DWORD time = GetTickCount() + diff;
while (diff > 0)
{
if (MsgWaitForMultipleObjects( 0, NULL, FALSE, min(10,diff), QS_ALLINPUT ) == WAIT_TIMEOUT) break;
if (MsgWaitForMultipleObjects( 0, NULL, FALSE, min_timeout, QS_ALLINPUT ) == WAIT_TIMEOUT) break;
while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg );
diff = time - GetTickCount();
min_timeout = 10;
}
}

View File

@ -63,13 +63,15 @@ static void flush_events(void)
{
MSG msg;
int diff = 200;
int min_timeout = 50;
DWORD time = GetTickCount() + diff;
while (diff > 0)
{
if (MsgWaitForMultipleObjects( 0, NULL, FALSE, min(10,diff), QS_ALLINPUT ) == WAIT_TIMEOUT) break;
if (MsgWaitForMultipleObjects( 0, NULL, FALSE, min_timeout, QS_ALLINPUT ) == WAIT_TIMEOUT) break;
while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg );
diff = time - GetTickCount();
min_timeout = 10;
}
}