From 6bccb65227c7d34bed08aa09f7fb642afab25352 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Wed, 18 Feb 2009 14:26:38 +0000 Subject: Check if we actually got an event before processing it svn path=/trunk/netsurf/; revision=6562 --- framebuffer/fb_frontend_sdl.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/framebuffer/fb_frontend_sdl.c b/framebuffer/fb_frontend_sdl.c index 74c564a2e..d17bcf772 100644 --- a/framebuffer/fb_frontend_sdl.c +++ b/framebuffer/fb_frontend_sdl.c @@ -88,12 +88,17 @@ void fb_os_quit(framebuffer_t *fb) void fb_os_input(struct gui_window *g, bool active) { + int got_event; SDL_Event event; if (active) - SDL_PollEvent(&event); + got_event = SDL_PollEvent(&event); else - SDL_WaitEvent(&event); + got_event = SDL_WaitEvent(&event); + + /* Do nothing if there was no event */ + if (got_event == 0) + return; switch (event.type) { case SDL_KEYDOWN: -- cgit v1.2.3