[Tizen] Allow to add idler even if adaptor paused 28/302628/1
authorEunki, Hong <eunkiki.hong@samsung.com>
Thu, 7 Dec 2023 06:23:02 +0000 (15:23 +0900)
committerEunki Hong <eunkiki.hong@samsung.com>
Mon, 11 Dec 2023 08:21:48 +0000 (17:21 +0900)
Let we install idler function even if Adaptor is paused.

Since the Adaptor pause state depend on by Windows visibility, not app state,
Application::AddIdle() API usage make some confused.

For example, We cannot call AddIdle() at Application::OnResume callback
because the Window::OnIconifyChanged signal still not comed.

To avoid it, let we just allow Idler function add even Adator is paused.

Change-Id: I943ef76d4e759e282675fbcbc06f0a87d95e9fea
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
dali/internal/adaptor/common/adaptor-impl.cpp
dali/internal/adaptor/common/adaptor-impl.h
dali/internal/adaptor/common/adaptor.cpp
dali/internal/adaptor/common/application-impl.cpp
dali/internal/offscreen/common/offscreen-application-impl.cpp

index c64cbdc..6001eb6 100644 (file)
@@ -663,12 +663,12 @@ Dali::TtsPlayer Adaptor::GetTtsPlayer(Dali::TtsPlayer::Mode mode)
   return mTtsPlayers[mode];
 }
 
-bool Adaptor::AddIdle(CallbackBase* callback, bool hasReturnValue, bool forceAdd)
+bool Adaptor::AddIdle(CallbackBase* callback, bool hasReturnValue)
 {
   bool idleAdded(false);
 
-  // Only add an idle if the Adaptor is actually running
-  if(RUNNING == mState || READY == mState || forceAdd)
+  // We want to run the processes even when paused
+  if(STOPPED != mState)
   {
     idleAdded = mCallbackManager->AddIdleCallback(callback, hasReturnValue);
   }
@@ -1004,7 +1004,7 @@ void Adaptor::RequestProcessEventsOnIdle()
     if(!mNotificationOnIdleInstalled)
     {
       // If we haven't installed the idle notification, install it idle enterer.
-      mNotificationOnIdleInstalled = AddIdleEnterer(MakeCallback(this, &Adaptor::ProcessCoreEventsFromIdle), true);
+      mNotificationOnIdleInstalled = AddIdleEnterer(MakeCallback(this, &Adaptor::ProcessCoreEventsFromIdle));
     }
     else
     {
@@ -1337,12 +1337,12 @@ void Adaptor::SetRootLayoutDirection(std::string locale)
   }
 }
 
-bool Adaptor::AddIdleEnterer(CallbackBase* callback, bool forceAdd)
+bool Adaptor::AddIdleEnterer(CallbackBase* callback)
 {
   bool idleAdded(false);
 
-  // Only add an idle if the Adaptor is actually running
-  if(RUNNING == mState || READY == mState || forceAdd)
+  // We want to run the processes even when paused
+  if(STOPPED != mState)
   {
     idleAdded = mCallbackManager->AddIdleEntererCallback(callback);
   }
index 279ff14..98d1dbc 100644 (file)
@@ -249,7 +249,7 @@ public: // AdaptorInternalServices implementation
   /**
    * @copydoc Dali::Adaptor::AddIdle()
    */
-  virtual bool AddIdle(CallbackBase* callback, bool hasReturnValue, bool forceAdd);
+  virtual bool AddIdle(CallbackBase* callback, bool hasReturnValue);
 
   /**
    * Adds a new Window instance to the Adaptor
@@ -652,7 +652,7 @@ private:
    * @endcode
    * This callback will be called repeatedly as long as it returns true. A return of 0 deletes this callback.
    */
-  bool AddIdleEnterer(CallbackBase* callback, bool forceAdd);
+  bool AddIdleEnterer(CallbackBase* callback);
 
   /**
    * Removes a previously added the idle enterer callback.
index 6ca95b2..c8d17ee 100644 (file)
@@ -88,7 +88,7 @@ void Adaptor::Stop()
 bool Adaptor::AddIdle(CallbackBase* callback, bool hasReturnValue)
 {
   DALI_ASSERT_ALWAYS(IsAvailable() && "Adaptor not instantiated");
-  return mImpl->AddIdle(callback, hasReturnValue, false);
+  return mImpl->AddIdle(callback, hasReturnValue);
 }
 
 bool Adaptor::AddWindow(Dali::Integration::SceneHolder childWindow)
index 0f18afa..44d4146 100644 (file)
@@ -346,7 +346,7 @@ void Application::Quit()
 {
   // Actually quit the application.
   // Force a call to Quit even if adaptor is not running.
-  Internal::Adaptor::Adaptor::GetImplementation(*mAdaptor).AddIdle(MakeCallback(this, &Application::QuitFromMainLoop), false, true);
+  Internal::Adaptor::Adaptor::GetImplementation(*mAdaptor).AddIdle(MakeCallback(this, &Application::QuitFromMainLoop), false);
 }
 
 void Application::QuitFromMainLoop()
index 1b2545a..f1fc2e7 100644 (file)
@@ -89,8 +89,7 @@ void OffscreenApplication::MainLoop()
 void OffscreenApplication::Quit()
 {
   // Actually quit the application.
-  // Force a call to Quit even if adaptor is not running.
-  Internal::Adaptor::Adaptor::GetImplementation(*mAdaptor).AddIdle(MakeCallback(this, &OffscreenApplication::QuitFromMainLoop), false, true);
+  Internal::Adaptor::Adaptor::GetImplementation(*mAdaptor).AddIdle(MakeCallback(this, &OffscreenApplication::QuitFromMainLoop), false);
 }
 
 Dali::OffscreenWindow OffscreenApplication::GetWindow()