void Adaptor::RequestProcessEventsOnIdle()
{
- // Only request a notification if we haven't installed the idle notification
// We want to run the processes even when paused
- if(!mNotificationOnIdleInstalled && STOPPED != mState)
+ if(STOPPED != mState)
{
- mNotificationOnIdleInstalled = AddIdleEnterer(MakeCallback(this, &Adaptor::ProcessCoreEventsFromIdle), true);
+ if(!mNotificationOnIdleInstalled)
+ {
+ // If we haven't installed the idle notification, install it idle enterer.
+ mNotificationOnIdleInstalled = AddIdleEnterer(MakeCallback(this, &Adaptor::ProcessCoreEventsFromIdle), true);
+ }
+ else
+ {
+ // Request comes during ProcessCoreEventsFromIdle running.
+ // Mark as we need to call ProcessEvents in next idle events.
+ mRequiredIdleRepeat = true;
+ }
}
}
bool Adaptor::ProcessCoreEventsFromIdle()
{
+ // Reset repeat idler flag.
+ mRequiredIdleRepeat = false;
ProcessCoreEvents();
- // the idle handle automatically un-installs itself
- mNotificationOnIdleInstalled = false;
+ // If someone request ProcessCoreEvents during above ProcessCoreEvents call, we might need to run idle one more times.
+ // Else, the idle handle automatically un-installs itself
+ mNotificationOnIdleInstalled = mRequiredIdleRepeat;
- return false;
+ if(mRequiredIdleRepeat)
+ {
+ DALI_LOG_DEBUG_INFO("Required ProcessCoreEvents one more times\n");
+ }
+
+ return mRequiredIdleRepeat;
}
Dali::Internal::Adaptor::SceneHolder* Adaptor::GetWindow(Dali::Actor& actor)
mPlatformAbstraction(nullptr),
mCallbackManager(nullptr),
mNotificationOnIdleInstalled(false),
+ mRequiredIdleRepeat(false),
mNotificationTrigger(nullptr),
mDaliFeedbackPlugin(),
mFeedbackController(nullptr),
std::unique_ptr<CallbackManager> mCallbackManager; ///< Used to install callbacks
bool mNotificationOnIdleInstalled; ///< whether the idle handler is installed to send an notification event
+ bool mRequiredIdleRepeat; ///< whether we need to repeat installed notification event in idle handler
TriggerEventInterface* mNotificationTrigger; ///< Notification event trigger
FeedbackPluginProxy* mDaliFeedbackPlugin; ///< Used to access feedback support
FeedbackController* mFeedbackController; ///< Plays feedback effects for Dali-Toolkit UI Controls.