Modify ecore_wl2_window_geometry_set() with window rotation angle 80/256380/2
authorWonsik Jung <sidein@samsung.com>
Thu, 1 Apr 2021 13:38:19 +0000 (22:38 +0900)
committerWonsik Jung <sidein@samsung.com>
Thu, 1 Apr 2021 22:27:36 +0000 (07:27 +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: I2d0de7455ef8e2be955bb156e28f050e985062b2

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;