Revert "[Tizen] Fix unParent Bug"
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / tizen-wayland / ecore-wl2 / window-base-ecore-wl2.cpp
index 1eee7a8..1c6a63b 100755 (executable)
@@ -2207,15 +2207,35 @@ void WindowBaseEcoreWl2::CreateWindow( PositionSize positionSize )
   ecore_wl2_window_type_set( mEcoreWindow, ECORE_WL2_WINDOW_TYPE_TOPLEVEL );
 }
 
-void WindowBaseEcoreWl2::SetParent( WindowBase* parentWinBase )
+void WindowBaseEcoreWl2::SetParent( Any parent )
 {
-  Ecore_Wl2_Window* ecoreParent = NULL;
-  if( parentWinBase )
+  Ecore_Wl2_Window* mEcoreParent;
+  if( parent.Empty() == false )
   {
-    WindowBaseEcoreWl2* winBaseEcore2 = static_cast<WindowBaseEcoreWl2*>( parentWinBase );
-    ecoreParent = winBaseEcore2->mEcoreWindow;
+    // check we have a valid type
+    DALI_ASSERT_ALWAYS( ( parent.GetType() == typeid (Ecore_Wl2_Window *) ) && "Parent's surface type is invalid" );
+    mEcoreParent = AnyCast< Ecore_Wl2_Window* >( parent );
+  }
+  else
+  {
+    mEcoreParent = NULL;
+  }
+  ecore_wl2_window_parent_set( mEcoreWindow, mEcoreParent );
+}
+
+bool WindowBaseEcoreWl2::IsMatchedWindow( Any window )
+{
+  bool ret = false;
+  if ( window.Empty() == false )
+  {
+    // check we have a valid type
+    DALI_ASSERT_ALWAYS( ( window.GetType() == typeid (Ecore_Wl2_Window *) ) && "Window's surface type is invalid" );
+    if ( AnyCast< Ecore_Wl2_Window*>( window ) == mEcoreWindow )
+    {
+      ret = true;
+    }
   }
-  ecore_wl2_window_parent_set( mEcoreWindow, ecoreParent );
+  return ret;
 }
 
 } // namespace Adaptor