Modify ecore_wl2_window_geometry_set() with window rotation angle 05/257305/1 accepted/tizen/6.0/unified/20210422.132218 submit/tizen_6.0/20210422.101220
authorWonsik Jung <sidein@samsung.com>
Thu, 22 Apr 2021 07:54:31 +0000 (16:54 +0900)
committerWonsik Jung <sidein@samsung.com>
Thu, 22 Apr 2021 07:56:17 +0000 (16:56 +0900)
Ecore-wl2 window should have the original window size and send rotation event with swapped size.
When window Hide() -> Show(), Show() function has the ecore_wl2_window_geomerty_set().
This function should be called to consider window rotation angle.

It is the back porting from the latest Tizen to fix rotation issue

Change-Id: Icea09d8fc55d25c3f7411a4266aedde3119c7d3a

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

index e5ff6cd..6fbd2de 100755 (executable)
@@ -1695,9 +1695,19 @@ void WindowBaseEcoreWl2::SetAcceptFocus( bool accept )
 
 void WindowBaseEcoreWl2::Show()
 {
-  if( !mVisible )
+  if(!mVisible)
   {
-    ecore_wl2_window_geometry_set( mEcoreWindow, mWindowPositionSize.x, mWindowPositionSize.y, mWindowPositionSize.width, mWindowPositionSize.height );
+    // Ecore-wl2 has the original window size
+    // and he always sends the window rotation event with the swapped size.
+    // So, to restore, dali should set the reswapped size(original window size) to ecore-wl2 for restoring.
+    if(mWindowRotationAngle == 0 || mWindowRotationAngle == 180)
+    {
+      ecore_wl2_window_geometry_set(mEcoreWindow, mWindowPositionSize.x, mWindowPositionSize.y, mWindowPositionSize.width, mWindowPositionSize.height);
+    }
+    else
+    {
+      ecore_wl2_window_geometry_set(mEcoreWindow, mWindowPositionSize.x, mWindowPositionSize.y, mWindowPositionSize.height, mWindowPositionSize.width);
+    }
   }
   mVisible = true;