From 7908971970ee9905f191569a12f8b7a882eec5d4 Mon Sep 17 00:00:00 2001 From: Almamu Date: Tue, 6 May 2025 03:09:28 +0200 Subject: [PATCH] fix: ensure that at least one frame is rendered before detecting fullscreen windows --- .../Application/CWallpaperApplication.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/WallpaperEngine/Application/CWallpaperApplication.cpp b/src/WallpaperEngine/Application/CWallpaperApplication.cpp index ecfd3fb..a2a9ee3 100644 --- a/src/WallpaperEngine/Application/CWallpaperApplication.cpp +++ b/src/WallpaperEngine/Application/CWallpaperApplication.cpp @@ -407,13 +407,6 @@ void CWallpaperApplication::show () { m_audioDriver->update (); // update input information m_videoDriver->getInputContext ().update (); - // check for fullscreen windows and wait until there's none fullscreen - if (this->m_fullScreenDetector->anythingFullscreen () && this->m_context.state.general.keepRunning) { - m_renderContext->setPause (true); - while (this->m_fullScreenDetector->anythingFullscreen () && this->m_context.state.general.keepRunning) - usleep (FULLSCREEN_CHECK_WAIT_TIME); - m_renderContext->setPause (false); - } // process driver events m_videoDriver->dispatchEventQueue (); @@ -421,6 +414,13 @@ void CWallpaperApplication::show () { sLog.out ("Stop requested by driver"); this->m_context.state.general.keepRunning = false; } + // check for fullscreen windows and wait until there's none fullscreen + if (this->m_fullScreenDetector->anythingFullscreen () && this->m_context.state.general.keepRunning) { + m_renderContext->setPause (true); + while (this->m_fullScreenDetector->anythingFullscreen () && this->m_context.state.general.keepRunning) + usleep (FULLSCREEN_CHECK_WAIT_TIME); + m_renderContext->setPause (false); + } if (!this->m_context.settings.screenshot.take || m_videoDriver->getFrameCounter () < this->m_context.settings.screenshot.delay) continue;