From e078a8b7b64bcce73bf934de3110de4423b4a661 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 6 Mar 2022 15:21:43 -0600 Subject: [PATCH] Don't recreate the decoder while the window is minimized Fixes #726 --- app/streaming/session.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/streaming/session.cpp b/app/streaming/session.cpp index 75287b51..0fa27aa8 100644 --- a/app/streaming/session.cpp +++ b/app/streaming/session.cpp @@ -1596,6 +1596,15 @@ void Session::execInternal() break; } } +#ifdef Q_OS_WIN32 + // We can get a resize event after being minimized. Recreating the renderer at that time can cause + // us to start drawing on the screen even while our window is minimized. Minimizing on Windows also + // moves the window to -32000, -32000 which can cause a false window display index change. Avoid + // that whole mess by never recreating the decoder if we're minimized. + else if (SDL_GetWindowFlags(m_Window) & SDL_WINDOW_MINIMIZED) { + break; + } +#endif // Complete any repositioning that was deferred until // the resize from full-screen to windowed had completed.