{
mAdaptor->RemoveObserver( *mLifeCycleObserver.get() );
mAdaptor->RemoveWindow( this );
+
+ mAdaptor->DeleteSurface( *mSurface.get() );
+
mAdaptor = nullptr;
}
OnSurfaceSet( surface );
}
+void SceneHolder::SurfaceResized( bool forceUpdate )
+{
+ mScene.SurfaceResized( forceUpdate );
+}
+
Dali::RenderSurfaceInterface* SceneHolder::GetSurface() const
{
return mSurface.get();
mAdaptorStarted = true;
// Create the scene
- PositionSize positionSize = mSurface->GetPositionSize();
- mScene = Dali::Integration::Scene::New( Vector2( positionSize.width, positionSize.height ) );
- mScene.SetSurface( *mSurface.get() );
+ mScene = Dali::Integration::Scene::New( *mSurface );
Internal::Adaptor::Adaptor& adaptorImpl = Internal::Adaptor::Adaptor::GetImplementation( adaptor );
mAdaptor = &adaptorImpl;
{
DALI_LOG_INFO( gTouchEventLogFilter, Debug::General, "%d: Device %d: Button state %d (%.2f, %.2f)\n", timeStamp, point.GetDeviceId(), point.GetState(), point.GetScreenPosition().x, point.GetScreenPosition().y );
+ // Signals can be emitted while processing core events, and the scene holder could be deleted in the signal callback.
+ // Keep the handle alive until the core events are processed.
+ Dali::BaseHandle sceneHolder( this );
+
// First the touch and/or hover event & related gesture events are queued
if( type == Integration::TouchEventCombiner::DispatchTouch || type == Integration::TouchEventCombiner::DispatchBoth )
{
void SceneHolder::FeedWheelEvent( Dali::Integration::WheelEvent& wheelEvent )
{
+ // Signals can be emitted while processing core events, and the scene holder could be deleted in the signal callback.
+ // Keep the handle alive until the core events are processed.
+ Dali::BaseHandle sceneHolder( this );
+
mScene.QueueEvent( wheelEvent );
mAdaptor->ProcessCoreEvents();
}
}
}
+ // Signals can be emitted while processing core events, and the scene holder could be deleted in the signal callback.
+ // Keep the handle alive until the core events are processed.
+ Dali::BaseHandle sceneHolder( this );
+
// Create send KeyEvent to Core.
mScene.QueueEvent( keyEvent );
mAdaptor->ProcessCoreEvents();
}
+Dali::Integration::SceneHolder SceneHolder::Get( Dali::Actor actor )
+{
+ SceneHolder* sceneHolderImpl = nullptr;
+
+ if ( Internal::Adaptor::Adaptor::IsAvailable() )
+ {
+ Dali::Internal::Adaptor::Adaptor& adaptor = Internal::Adaptor::Adaptor::GetImplementation( Internal::Adaptor::Adaptor::Get() );
+ sceneHolderImpl = adaptor.GetWindow( actor );
+ }
+
+ return Dali::Integration::SceneHolder( sceneHolderImpl );
+}
+
void SceneHolder::Reset()
{
mCombiner.Reset();