From: Adeel Kazmi Date: Tue, 18 Aug 2015 10:02:26 +0000 (+0100) Subject: Emit the resume signal before we update X-Git-Tag: dali_1.1.0~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F40%2F46240%2F3;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git Emit the resume signal before we update [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 --- diff --git a/adaptors/common/adaptor-impl.cpp b/adaptors/common/adaptor-impl.cpp index 57d01a0..e261926 100644 --- a/adaptors/common/adaptor-impl.cpp +++ b/adaptors/common/adaptor-impl.cpp @@ -300,9 +300,6 @@ void Adaptor::Resume() // 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 @@ -317,9 +314,10 @@ void Adaptor::Resume() (*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(); } } diff --git a/adaptors/common/application-impl.cpp b/adaptors/common/application-impl.cpp index fc4a035..e7c1a3a 100644 --- a/adaptors/common/application-impl.cpp +++ b/adaptors/common/application-impl.cpp @@ -239,9 +239,11 @@ void Application::OnPause() 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()