Emit the resume signal before we update 40/46240/3
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Tue, 18 Aug 2015 10:02:26 +0000 (11:02 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Tue, 18 Aug 2015 14:37:49 +0000 (15:37 +0100)
[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

adaptors/common/adaptor-impl.cpp
adaptors/common/application-impl.cpp

index 57d01a0..e261926 100644 (file)
@@ -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();
   }
 }
index fc4a035..e7c1a3a 100644 (file)
@@ -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()