[Tizen] Fix Window-rotaion's bugs 43/217743/1
authorWonsik Jung <sidein@samsung.com>
Thu, 14 Nov 2019 03:38:06 +0000 (12:38 +0900)
committerWonsik Jung <sidein@samsung.com>
Thu, 14 Nov 2019 03:38:06 +0000 (12:38 +0900)
Fix Window-rotation's bugs
keep rotaton angle
  ecore_wl2_window_available_rotations_set's input value should be kept in DALi.
  Because ecore-wl2 does not keep the data as the below code.

  ecore_wl2_window_available_rotations_set(Ecore_Wl2_Window *window, const int *rots, unsigned int count)
  {
     ...
     window->wm_rot.available_rots = (int *)rots;
  }
It is temporary patch. When ecore-wl2 is fixed, it will be reverted.

Change-Id: Id4e898869d32f2bd9d6d1b94be4606cb12e56e36

dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp
dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h
dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp
dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h

index 5495b17..d807f8c 100644 (file)
@@ -654,6 +654,11 @@ void WindowBaseEcoreWl::Initialize( PositionSize positionSize, Any surface, bool
     CreateWindow( positionSize );
   }
 
+  for( int i = 0; i < 4; ++i )
+  {
+    mAvaiableWindowOrientations[i] = 0;
+  }
+
   mWlSurface = ecore_wl_window_surface_create( mEcoreWindow );
 
   SetTransparency( isTransparent );
@@ -1366,12 +1371,12 @@ void WindowBaseEcoreWl::Activate()
 
 void WindowBaseEcoreWl::SetAvailableOrientations( const std::vector< Dali::Window::WindowOrientation >& orientations )
 {
-  int rotations[4] = { 0 };
-  for( std::size_t i = 0; i < orientations.size(); ++i )
+  std::size_t size = orientations.size();
+  for( std::size_t i = 0; i < size; ++i )
   {
-    rotations[i] = static_cast< int >( orientations[i] );
+    mAvaiableWindowOrientations[i] = static_cast< int >( orientations[i] );
   }
-  ecore_wl_window_rotation_available_rotations_set( mEcoreWindow, rotations, orientations.size() );
+  ecore_wl_window_rotation_available_rotations_set( mEcoreWindow, mAvaiableWindowOrientations, size );
 }
 
 void WindowBaseEcoreWl::SetPreferredOrientation( Dali::Window::WindowOrientation orientation )
index de04a33..8b87802 100644 (file)
@@ -489,6 +489,8 @@ private:
   int                                  mWindowRotationAngle;
   int                                  mScreenRotationAngle;
   int                                  mSupportedPreProtation;
+
+  int                                  mAvaiableWindowOrientations[4];
 #ifdef DALI_ELDBUS_AVAILABLE
   Eldbus_Connection*                   mSystemConnection;
 #endif // DALI_ELDBUS_AVAILABLE
index de1c76d..3fbda3a 100755 (executable)
@@ -711,6 +711,11 @@ void WindowBaseEcoreWl2::Initialize( PositionSize positionSize, Any surface, boo
     CreateWindow( positionSize );
   }
 
+  for( int i = 0; i < 4; ++i )
+  {
+    mAvaiableWindowOrientations[i] = 0;
+  }
+
   mWlSurface = ecore_wl2_window_surface_get( mEcoreWindow );
 
   SetTransparency( isTransparent );
@@ -1459,12 +1464,12 @@ void WindowBaseEcoreWl2::Activate()
 
 void WindowBaseEcoreWl2::SetAvailableOrientations( const std::vector< Dali::Window::WindowOrientation >& orientations )
 {
-  int rotations[4] = { 0 };
-  for( std::size_t i = 0; i < orientations.size(); ++i )
+  std::size_t size = orientations.size();
+  for( std::size_t i = 0; i < size; ++i )
   {
-    rotations[i] = static_cast< int >( orientations[i] );
+    mAvaiableWindowOrientations[i] = static_cast< int >( orientations[i] );
   }
-  ecore_wl2_window_available_rotations_set( mEcoreWindow, rotations, orientations.size() );
+  ecore_wl2_window_available_rotations_set( mEcoreWindow, mAvaiableWindowOrientations, size );
 }
 
 void WindowBaseEcoreWl2::SetPreferredOrientation( Dali::Window::WindowOrientation orientation )
index b64a873..639ca88 100644 (file)
@@ -502,6 +502,8 @@ private:
   int                                  mWindowRotationAngle;
   int                                  mScreenRotationAngle;
   int                                  mSupportedPreProtation;
+
+  int                                  mAvaiableWindowOrientations[4];
 #ifdef DALI_ELDBUS_AVAILABLE
   Eldbus_Connection*                   mSystemConnection;
 #endif // DALI_ELDBUS_AVAILABLE