From a0c77d0ad83b770e186340edbb29b278312a8e9c Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 9 Jun 2024 14:34:34 -0500 Subject: [PATCH] Filter SDL_WINDOWEVENT_SHOWN after initial renderer creation This case exists to handle the initial bringup of the renderer when the window appears on screen. We can ignore these if we already created a renderer, to avoid renderer re-creation if a spurious SDL_WINDOWEVENT_SHOWN event arrives later. --- app/streaming/session.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/streaming/session.cpp b/app/streaming/session.cpp index 887f2386..968b1713 100644 --- a/app/streaming/session.cpp +++ b/app/streaming/session.cpp @@ -1948,7 +1948,8 @@ void Session::execInternal() // We want to recreate the decoder for resizes (full-screen toggles) and the initial shown event. // We use SDL_WINDOWEVENT_SIZE_CHANGED rather than SDL_WINDOWEVENT_RESIZED because the latter doesn't // seem to fire when switching from windowed to full-screen on X11. - if (event.window.event != SDL_WINDOWEVENT_SIZE_CHANGED && event.window.event != SDL_WINDOWEVENT_SHOWN) { + if (event.window.event != SDL_WINDOWEVENT_SIZE_CHANGED && + (event.window.event != SDL_WINDOWEVENT_SHOWN || m_VideoDecoder != nullptr)) { // Check that the window display hasn't changed. If it has, we want // to recreate the decoder to allow it to adapt to the new display. // This will allow Pacer to pull the new display refresh rate.