From f8b127102734bf8eb1529eadb3f734d60c47efa0 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Thu, 25 Apr 2024 04:16:44 -0400 Subject: [PATCH] - ignore SDL_WaitEvent errors --- src/window/sdl2/sdl2displaywindow.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/window/sdl2/sdl2displaywindow.cpp b/src/window/sdl2/sdl2displaywindow.cpp index ac33848..f80fe86 100644 --- a/src/window/sdl2/sdl2displaywindow.cpp +++ b/src/window/sdl2/sdl2displaywindow.cpp @@ -286,11 +286,10 @@ void SDL2DisplayWindow::RunLoop() while (!ExitRunLoop) { - SDL_Event event; + SDL_Event event = {}; int result = SDL_WaitEvent(&event); - if (result == 0) - fprintf(stderr, "SDL_WaitEvent failed: %s\n", SDL_GetError()); - DispatchEvent(event); + if (result == 1) + DispatchEvent(event); // Silently ignore if it fails and pray it doesn't busy loop, because SDL and Linux utterly sucks! } }