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>
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);
}
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
{
}
}
-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);
}
/**
* @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
* @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.
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)
{
// 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()
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()