Qt/GameListBackground: Make focus detection less agressive

So that custom background can still play when child window is focused
This commit is contained in:
KamFretoZ
2026-06-16 21:46:56 +07:00
committed by lightningterror
parent 07aa5786e5
commit aea83d5ece
2 changed files with 4 additions and 9 deletions
+3 -8
View File
@@ -452,20 +452,15 @@ void GameListWidget::setCustomBackground()
m_table_view->viewport()->setAutoFillBackground(false);
m_list_view->viewport()->setAutoFillBackground(false);
m_background_movie->start();
updateCustomBackgroundState(true);
updateCustomBackgroundState();
m_table_view->setAlternatingRowColors(false);
processBackgroundFrames();
}
void GameListWidget::updateCustomBackgroundState(const bool force_start)
void GameListWidget::updateCustomBackgroundState()
{
if (m_background_movie && m_background_movie->isValid())
{
if ((isVisible() && (isActiveWindow() || force_start)) && qGuiApp->applicationState() == Qt::ApplicationActive)
m_background_movie->setPaused(false);
else
m_background_movie->setPaused(true);
}
m_background_movie->setPaused(!(isVisible() && qGuiApp->applicationState() == Qt::ApplicationActive));
}
void GameListWidget::processBackgroundFrames()
+1 -1
View File
@@ -54,7 +54,7 @@ public:
void cancelRefresh();
void reloadThemeSpecificImages();
void setCustomBackground();
void updateCustomBackgroundState(const bool force_start = false);
void updateCustomBackgroundState();
void processBackgroundFrames();
void updateBackgroundTextColor(const QPixmap& frame);