diff --git a/test/testwm.c b/test/testwm.c index 24b5a0f05..3e1a75978 100644 --- a/test/testwm.c +++ b/test/testwm.c @@ -154,7 +154,17 @@ static void loop(void) { int i; SDL_Event event; - /* Check for events */ + +#ifdef TEST_WAITEVENTTIMEOUT + /* Wait up to 20 ms for input, as a test */ + Uint64 then = SDL_GetTicks(); + if (SDL_WaitEventTimeout(NULL, 20)) { + SDL_Log("Got an event!\n"); + } + Uint64 now = SDL_GetTicks(); + SDL_Log("Waited %d ms for events\n", (int)(now - then)); +#endif + while (SDL_PollEvent(&event)) { SDLTest_CommonEvent(state, &event, &done);