Reduced CPU usage significantly when a menu is open.

This commit is contained in:
Leon Styhre 2022-01-19 19:31:27 +01:00
parent 7275f020f1
commit 2aabe2eef3

View file

@ -438,6 +438,16 @@ void Window::render()
Settings::getInstance()->getString("ScreensaverType") == "slideshow") Settings::getInstance()->getString("ScreensaverType") == "slideshow")
renderBottom = false; 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) if (renderBottom)
bottom->render(trans); bottom->render(trans);