X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fintegration-api%2Fscene-holder-impl.cpp;h=a5eca047e67e10bc2eb9f3dc3b23d2a265154973;hb=53fdb2e5468ea10660fa8ef1e2247c05bff7edb2;hp=d8d456fcbaeccb022a507dfa9b63aae6769a2a7e;hpb=4a0a44830468ad7ee43938f7118d71728a5a9376;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/integration-api/scene-holder-impl.cpp b/dali/integration-api/scene-holder-impl.cpp index d8d456f..a5eca04 100644 --- a/dali/integration-api/scene-holder-impl.cpp +++ b/dali/integration-api/scene-holder-impl.cpp @@ -287,6 +287,10 @@ void SceneHolder::FeedTouchPoint( Dali::Integration::Point& point, int timeStamp { 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 ) { @@ -305,6 +309,10 @@ void SceneHolder::FeedTouchPoint( Dali::Integration::Point& point, int timeStamp 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(); } @@ -320,11 +328,28 @@ void SceneHolder::FeedKeyEvent( Dali::Integration::KeyEvent& keyEvent ) } } + // 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();