From 619742f70f004ae7c876beb74a57113ff8b34173 Mon Sep 17 00:00:00 2001 From: krcroft Date: Sat, 28 Mar 2020 20:42:17 -0700 Subject: [PATCH] Improve comment about EXPOSED event --- src/gui/sdlmain.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gui/sdlmain.cpp b/src/gui/sdlmain.cpp index 2d036b89..ab88feaf 100644 --- a/src/gui/sdlmain.cpp +++ b/src/gui/sdlmain.cpp @@ -2208,7 +2208,14 @@ void GFX_Events() { case SDL_WINDOWEVENT_RESIZED: GFX_HandleVideoResize(event.window.data1, event.window.data2); continue; - // window has been exposed and needs to be redrawn + /* + * EXPOSED indicates that the window needs to be redrawn. + * Note that on Windows/Linux-X11/Wayland/macOS, the EXPOSED event + * is fired after toggling between full vs windowed modes. However this is + * never fired on the Raspberry Pi (when rendering to the Framebuffer); + * therefore we rely on the FOCUS_GAINED event to catch window startup + * and size toggles. + */ case SDL_WINDOWEVENT_EXPOSED: if (sdl.draw.callback) sdl.draw.callback(GFX_CallBackRedraw);