[Problem] We'd signal the application AFTER we'd already done a first update
upon resume so the first frame shown would just show the last frame
before we were paused.
[Solution] Emit the signal first on resume so the application can queue any
messages. Then we should process the messages (but only once as
Core::Resume also does it). Finally, we should kick off the thread
controller, so the first update that we do is what was required by
the application.
Change-Id: I6dda0b70f29b47da91f5dc430447b54f7526067d
// Only resume the adaptor if we are in the suspended state.
if( PAUSED == mState )
{
- // Resume core first
- mCore->Resume();
-
mState = RUNNING;
// Reset the event handler when adaptor resumed
(*iter)->OnResume();
}
- ProcessCoreEvents(); // Ensure any outstanding messages are processed
+ // Resume core so it processes any requests as well
+ mCore->Resume();
- // Ensure our first update includes the processed messages
+ // Do at end to ensure our first update/render after resumption includes the processed messages as well
mThreadController->Resume();
}
}
void Application::OnResume()
{
- mAdaptor->Resume();
+ // Emit the signal first so the application can queue any messages before we do an update/render
+ // This ensures we do not just redraw the last frame before pausing if that's not required
Dali::Application application(this);
mResumeSignal.Emit( application );
+ mAdaptor->Resume();
}
void Application::OnReset()