From 2aabe2eef38868107f0011bf91e68cda3bf2fb19 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Wed, 19 Jan 2022 19:31:27 +0100 Subject: [PATCH] Reduced CPU usage significantly when a menu is open. --- es-core/src/Window.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/es-core/src/Window.cpp b/es-core/src/Window.cpp index 1ee087921..89abbdd7e 100644 --- a/es-core/src/Window.cpp +++ b/es-core/src/Window.cpp @@ -438,6 +438,16 @@ void Window::render() Settings::getInstance()->getString("ScreensaverType") == "slideshow") renderBottom = false; + // Don't render the bottom if the menu is open and the opening animation has finished + // playing. If the background is invalidated rendering will be enabled briefly until + // a new cached background has been generated. + if (mGuiStack.size() > 1 && mCachedBackground) { + if ((Settings::getInstance()->getString("MenuOpeningEffect") == "scale-up" && + mBackgroundOverlayOpacity == 255) || + Settings::getInstance()->getString("MenuOpeningEffect") != "scale-up") + renderBottom = false; + } + if (renderBottom) bottom->render(trans);