Add the exception case for window rotation. 02/259802/1
authorWonsik Jung <sidein@samsung.com>
Tue, 15 Jun 2021 00:49:50 +0000 (09:49 +0900)
committerWonsik Jung <sidein@samsung.com>
Tue, 15 Jun 2021 00:53:24 +0000 (09:53 +0900)
When window rotaton event occurs, the window's size in rotation evnet value is initialized with 0 value.
To fix that, if window's size in rotation event value is zero, the value should be modified using DALi local data.
In addition, fix the one human error.

Change-Id: I03330dcb491b70e6b3abe1e56a9043b859adb215

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

index 4fe0a30..b8227e0 100644 (file)
@@ -980,6 +980,22 @@ void WindowBaseEcoreWl2::OnRotation(void* data, int type, void* event)
     RotationEvent rotationEvent;
     rotationEvent.angle     = ev->angle;
     rotationEvent.winResize = 0;
+
+    if(ev->w == 0 || ev->h ==0)
+    {
+      // Use previous client side window's size.
+      if(mWindowRotationAngle == 90 || mWindowRotationAngle == 270)
+      {
+        ev->w = mWindowPositionSize.height;
+        ev->h = mWindowPositionSize.width;
+      }
+      else
+      {
+        ev->w = mWindowPositionSize.width;
+        ev->h = mWindowPositionSize.height;
+      }
+    }
+
     mWindowRotationAngle    = ev->angle;
 
     if(ev->angle == 0 || ev->angle == 180)
@@ -1940,7 +1956,7 @@ Dali::WindowOperationResult WindowBaseEcoreWl2::SetNotificationLevel(Dali::Windo
   if(!mNotificationLevelChangeDone)
   {
     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetNotificationLevel: Level change is failed [%d, %d]\n", level, mNotificationChangeState);
-    Dali::WindowOperationResult::UNKNOWN_ERROR;
+    return Dali::WindowOperationResult::UNKNOWN_ERROR;
   }
   else if(mNotificationChangeState == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED)
   {