mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 16:41:02 +02:00
Merge pull request #5414 from birarda/slow-events
allow the QEvent queue in Application to get behind
This commit is contained in:
commit
939638a3a8
1 changed files with 2 additions and 13 deletions
|
@ -1802,13 +1802,6 @@ void Application::idle() {
|
||||||
}
|
}
|
||||||
double timeSinceLastUpdate = (double)_lastTimeUpdated.nsecsElapsed() / 1000000.0;
|
double timeSinceLastUpdate = (double)_lastTimeUpdated.nsecsElapsed() / 1000000.0;
|
||||||
if (timeSinceLastUpdate > targetFramePeriod) {
|
if (timeSinceLastUpdate > targetFramePeriod) {
|
||||||
|
|
||||||
{
|
|
||||||
static const int IDLE_EVENT_PROCESS_MAX_TIME_MS = 2;
|
|
||||||
PerformanceTimer perfTimer("processEvents");
|
|
||||||
processEvents(QEventLoop::AllEvents, IDLE_EVENT_PROCESS_MAX_TIME_MS);
|
|
||||||
}
|
|
||||||
|
|
||||||
_lastTimeUpdated.start();
|
_lastTimeUpdated.start();
|
||||||
{
|
{
|
||||||
PerformanceTimer perfTimer("update");
|
PerformanceTimer perfTimer("update");
|
||||||
|
@ -1840,12 +1833,8 @@ void Application::idle() {
|
||||||
// Once rendering is off on another thread we should be able to have Application::idle run at start(0) in
|
// Once rendering is off on another thread we should be able to have Application::idle run at start(0) in
|
||||||
// perpetuity and not expect events to get backed up.
|
// perpetuity and not expect events to get backed up.
|
||||||
|
|
||||||
static const int IDLE_TIMER_DELAY_MS = 0;
|
static const int IDLE_TIMER_DELAY_MS = 2;
|
||||||
int desiredInterval = _glWidget->isThrottleRendering() ? THROTTLED_IDLE_TIMER_DELAY : IDLE_TIMER_DELAY_MS;
|
idleTimer->start(_glWidget->isThrottleRendering() ? THROTTLED_IDLE_TIMER_DELAY : IDLE_TIMER_DELAY_MS);
|
||||||
|
|
||||||
if (idleTimer->interval() != desiredInterval) {
|
|
||||||
idleTimer->start(desiredInterval);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for any requested background downloads.
|
// check for any requested background downloads.
|
||||||
|
|
Loading…
Reference in a new issue