From 91ab9e93481668cbaddb53ec04b61872f2d0fa03 Mon Sep 17 00:00:00 2001 From: Wonsik Jung Date: Thu, 14 Nov 2019 12:38:06 +0900 Subject: [PATCH] [Tizen] Fix Window-rotaion's bugs 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 --- .../tizen-wayland/ecore-wl/window-base-ecore-wl.cpp | 13 +++++++++---- .../tizen-wayland/ecore-wl/window-base-ecore-wl.h | 2 ++ .../tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp | 13 +++++++++---- .../tizen-wayland/ecore-wl2/window-base-ecore-wl2.h | 2 ++ 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp index 5495b17a..d807f8c 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp +++ b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp @@ -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 ) diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h index de04a33..8b87802 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h +++ b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h @@ -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 diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp index de1c76d..3fbda3a 100755 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp @@ -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 ) diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h index b64a873..639ca88 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h @@ -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 -- 2.7.4