Revert "[Tizen] Add screen and client rotation itself function"
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / common / window-impl.cpp
index d5f8383..7759dad 100644 (file)
@@ -454,13 +454,7 @@ void Window::SetSize( Dali::Window::WindowSize size )
   {
     Uint16Pair newSize( newRect.width, newRect.height );
 
-    bool forceUpdate = false;
-    if( mWindowBase->IsEglWindowRotationSupported() )
-    {
-      forceUpdate = true;
-    }
-
-    SurfaceResized( forceUpdate );
+    SurfaceResized();
 
     mAdaptor->SurfaceResizePrepare( mSurface.get(), newSize );
 
@@ -518,13 +512,7 @@ void Window::SetPositionSize( PositionSize positionSize )
   {
     Uint16Pair newSize( newRect.width, newRect.height );
 
-    bool forceUpdate = false;
-    if( mWindowBase->IsEglWindowRotationSupported() )
-    {
-      forceUpdate = true;
-    }
-
-    SurfaceResized( forceUpdate );
+    SurfaceResized();
 
     mAdaptor->SurfaceResizePrepare( mSurface.get(), newSize );
 
@@ -602,13 +590,8 @@ void Window::OnFocusChanged( bool focusIn )
 
 void Window::OnOutputTransformed()
 {
-  bool forceUpdate = false;
-  if( mWindowBase->IsEglWindowRotationSupported() )
-  {
-    forceUpdate = true;
-  }
   PositionSize positionSize = mSurface->GetPositionSize();
-  SurfaceResized( forceUpdate );
+  SurfaceResized();
   mAdaptor->SurfaceResizePrepare( mSurface.get(), Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
   mAdaptor->SurfaceResizeComplete( mSurface.get(), Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
 }
@@ -644,22 +627,16 @@ void Window::OnRotation( const RotationEvent& rotation )
 
   mWindowSurface->RequestRotation( mRotationAngle, mWindowWidth, mWindowHeight );
 
-  bool forceUpdate = false;
-  if( mWindowBase->IsEglWindowRotationSupported() )
-  {
-    forceUpdate = true;
-  }
-
-  SurfaceResized( forceUpdate );
+  SurfaceResized();
 
-  mAdaptor->SurfaceResizePrepare( mSurface.get(), Adaptor::SurfaceSize( mWindowWidth, mWindowHeight ) );
+  mAdaptor->SurfaceResizePrepare( mSurface.get(), Adaptor::SurfaceSize( mRotationAngle, mWindowHeight ) );
 
   // Emit signal
   Dali::Window handle( this );
-  mResizedSignal.Emit( Dali::Window::WindowSize( mWindowWidth, mWindowHeight ) );
-  mResizeSignal.Emit( handle, Dali::Window::WindowSize( mWindowWidth, mWindowHeight ) );
+  mResizedSignal.Emit( Dali::Window::WindowSize( mRotationAngle, mWindowHeight ) );
+  mResizeSignal.Emit( handle, Dali::Window::WindowSize( mRotationAngle, mWindowHeight ) );
 
-  mAdaptor->SurfaceResizeComplete( mSurface.get(), Adaptor::SurfaceSize( mWindowWidth, mWindowHeight ) );
+  mAdaptor->SurfaceResizeComplete( mSurface.get(), Adaptor::SurfaceSize( mRotationAngle, mWindowHeight ) );
 }
 
 void Window::OnPause()
@@ -731,20 +708,20 @@ void Window::SetParent( Dali::Window& parent )
   if ( DALI_UNLIKELY( parent ) )
   {
     mParentWindow = parent;
-    Dali::Window self = Dali::Window( this );
+    Dali::Window grandParent = Dali::DevelWindow::GetParent( parent );
     // check circular parent window setting
-    if ( Dali::DevelWindow::GetParent( parent ) == self )
+    if ( DALI_UNLIKELY( grandParent ) && mWindowBase->IsMatchedWindow( grandParent.GetNativeHandle() ) )
     {
       Dali::DevelWindow::Unparent( parent );
     }
-    mWindowBase->SetParent( GetImplementation( mParentWindow ).mWindowBase );
+    mWindowBase->SetParent( parent.GetNativeHandle() );
   }
 }
 
 void Window::Unparent()
 {
-  mWindowBase->SetParent( nullptr );
-  mParentWindow.Reset();
+  Any parent;
+  mWindowBase->SetParent( parent );
 }
 
 Dali::Window Window::GetParent()