sdlterm/src/sdlterm.cc
changeset 62 2f61931520c9
parent 61 15088f62c4ac
child 67 71f60bf6ebb7
--- a/sdlterm/src/sdlterm.cc	Thu Jan 10 00:03:34 2013 +0100
+++ b/sdlterm/src/sdlterm.cc	Fri Jan 18 22:36:50 2013 +0100
@@ -371,9 +371,6 @@
 
 bool Terminal::wait_event(Event &event, Uint32 timeout)
 {
-    static SDL_Event sdl_event;
-    bool event_ready = false;
-
     // use timer to simulate SDL_WaitEventTimeout, which is not available in SDL 1.2
     SDL_TimerID timer_id = NULL;
     if (timeout)
@@ -381,6 +378,9 @@
         timer_id = SDL_AddTimer(timeout, _wait_event_callback, NULL);
     }
 
+    // loop until we have something to return
+    SDL_Event sdl_event;
+    bool event_ready = false;
     while (SDL_WaitEvent(&sdl_event) && !event_ready)
     {
         switch (sdl_event.type)