[Tizen] Fix Window-rotaion's bugs submit/tizen_5.5/20191121.042511
authorHeeyong Song <heeyong.song@samsung.com>
Wed, 20 Nov 2019 08:20:04 +0000 (17:20 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Wed, 20 Nov 2019 08:20:07 +0000 (17:20 +0900)
Change-Id: I2f5f4218913dc80d14b4a158a0638412faa9a5d0

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