[Tizen] Modify ecore_wl2_window_geometry_set() with window rotation angle 87/256387/2
authorWonsik Jung <sidein@samsung.com>
Thu, 1 Apr 2021 23:15:45 +0000 (08:15 +0900)
committerWonsik Jung <sidein@samsung.com>
Thu, 1 Apr 2021 23:18:24 +0000 (08:18 +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.

Change-Id: I01bd97b5cb13be1bca4999806858e08b8c5e3c13

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

index 7d923b6..4c91c35 100644 (file)
@@ -1661,7 +1661,17 @@ void WindowBaseEcoreWl2::Show()
 {
   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;