Revert "[Tizen] Add screen and client rotation itself function"
[platform/core/uifw/dali-core.git] / dali / internal / event / common / property-notification-impl.cpp
index ee87eb1..7e407ca 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -46,14 +46,12 @@ PropertyNotificationPtr PropertyNotification::New(Property& target,
 
   UpdateManager& updateManager = tls.GetUpdateManager();
 
-  PropertyNotificationManager& propertyNotificationManager = Stage::GetCurrent()->GetPropertyNotificationManager();
-
+  PropertyNotificationManager& propertyNotificationManager = tls.GetPropertyNotificationManager();
   PropertyNotificationPtr propertyNotification = new PropertyNotification(updateManager,
                                                                           propertyNotificationManager,
                                                                           target,
                                                                           componentIndex,
                                                                           condition);
-
   return propertyNotification;
 }
 
@@ -103,13 +101,8 @@ PropertyNotification::PropertyNotification( UpdateManager& updateManager,
       }
     }
 
-    // Check if target scene-object already present, and if so create our notification
-    // scene-object
-    const SceneGraph::PropertyOwner* object = mObject->GetSceneObject();
-    if (object)
-    {
-      CreateSceneObject();
-    }
+    // all objects always have scene object
+    CreateSceneObject();
   }
 
   // Connect to the property notification manager
@@ -206,19 +199,16 @@ void PropertyNotification::CreateSceneObject()
   // this method can be called from constructor and on stage connection
   if( !mPropertyNotification )
   {
-    // Create a new PropertyNotification, temporarily owned
-    SceneGraph::PropertyNotification* propertyNotification = SceneGraph::PropertyNotification::New( *mObject,
-                                                                                                    mObjectPropertyIndex,
-                                                                                                    mPropertyType,
-                                                                                                    mComponentIndex,
-                                                                                                    GetImplementation(mCondition).type,
-                                                                                                    mRawConditionArgs,
-                                                                                                    mNotifyMode );
-    // Keep a const pointer to the PropertyNotification.
-    mPropertyNotification = propertyNotification;
-
-    // Transfer scene object ownership to the update manager through a message
-    AddPropertyNotificationMessage( mUpdateManager, propertyNotification );
+    // Create a new PropertyNotification, keep a const pointer to it
+    mPropertyNotification = SceneGraph::PropertyNotification::New( *mObject,
+                                                                   mObjectPropertyIndex,
+                                                                   mPropertyType,
+                                                                   mComponentIndex,
+                                                                   GetImplementation( mCondition ).type,
+                                                                   mRawConditionArgs,
+                                                                   mNotifyMode );
+    OwnerPointer< SceneGraph::PropertyNotification > transferOwnership( const_cast<SceneGraph::PropertyNotification*>( mPropertyNotification ) );
+    AddPropertyNotificationMessage( mUpdateManager, transferOwnership );
   }
 }