Merge pull request #5692 from aws-lumberyard-dev/Atom/guthadam/throttle_material_editor_updates_when_inactive
Reduce material editor update interval when inactive
This commit is contained in:
@@ -79,12 +79,18 @@ namespace AtomToolsFramework
|
|||||||
m_styleManager.reset(new AzQtComponents::StyleManager(this));
|
m_styleManager.reset(new AzQtComponents::StyleManager(this));
|
||||||
m_styleManager->initialize(this, engineRootPath);
|
m_styleManager->initialize(this, engineRootPath);
|
||||||
|
|
||||||
connect(&m_timer, &QTimer::timeout, this, [&]()
|
m_timer.setInterval(1);
|
||||||
|
connect(&m_timer, &QTimer::timeout, this, [this]()
|
||||||
{
|
{
|
||||||
this->PumpSystemEventLoopUntilEmpty();
|
this->PumpSystemEventLoopUntilEmpty();
|
||||||
this->Tick();
|
this->Tick();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
connect(this, &QGuiApplication::applicationStateChanged, this, [this]()
|
||||||
|
{
|
||||||
|
// Limit the update interval when not in focus to reduce power consumption and interference with other applications
|
||||||
|
this->m_timer.setInterval((applicationState() & Qt::ApplicationActive) ? 1 : 32);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
AtomToolsApplication ::~AtomToolsApplication()
|
AtomToolsApplication ::~AtomToolsApplication()
|
||||||
|
|||||||
Reference in New Issue
Block a user