Fix WindowManager Rotation
authorChoi Munseok <ms47.choi@samsung.com>
Tue, 26 Mar 2013 05:59:56 +0000 (14:59 +0900)
committerChoi Munseok <ms47.choi@samsung.com>
Tue, 26 Mar 2013 05:59:56 +0000 (14:59 +0900)
Change-Id: Ifc965467a00201740552f2508f41bca3ee5cb342
Signed-off-by: Choi Munseok <ms47.choi@samsung.com>
src/ui/FUi_ControlManager.cpp
src/ui/FUi_EcoreEvas.cpp
src/ui/FUi_OrientationAgent.cpp
src/ui/controls/FUiCtrl_ContextMenu.cpp

index 7dc3bc5..c14069e 100644 (file)
@@ -554,7 +554,6 @@ _ControlManager::ActivateWindow(_Window& window)
                        pEcoreEvas->RotateWindow(window, ::Convert(__orientationStatus));
                }
 #else
-               // Initialize window rotation.
                _EcoreEvas* pEcoreEvas = ::GetEcoreEvasMgr()->GetEcoreEvas();
                if (pEcoreEvas)
                {
index 1435eb1..1bbcd83 100644 (file)
@@ -1230,7 +1230,22 @@ _EcoreEvas::UpdateWindowBounds(const _Window& window)
 
        int rotation = ecore_evas_rotation_get(pLayer->GetEcoreEvas());
 
-       if (fullScreen == false)
+       if (fullScreen)
+       {
+               evas_object_move(pWinObj, 0, 0);
+
+               if ((rotation == 0) || (rotation == 180))
+               {
+                       evas_object_resize(pWinObj, rootW, rootH);
+               }
+               else
+               {
+                       evas_object_resize(pWinObj, rootH, rootW);
+               }
+
+               SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x, FULL SCREEN] Update bounds(rot = %d).", win, rotation);
+       }
+       else
        {
                Rectangle winBounds = _CoordinateSystemUtils::Transform(window.GetBounds());
 
@@ -1257,6 +1272,8 @@ _EcoreEvas::UpdateWindowBounds(const _Window& window)
 
                evas_object_move(pWinObj, winX, winY);
                evas_object_resize(pWinObj, winBounds.width, winBounds.height);
+
+               SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x, PARTIAL SCREEN] Update bounds(rot = %d, %d, %d, %d, %d).", win, rotation, winX, winY, winBounds.width, winBounds.height);
        }
 }
 #else
@@ -2159,6 +2176,8 @@ _EcoreEvas::SetWindowBounds(const _Window& window, const Rectangle& bounds)
        evas_object_move(pWinObject, winX, winY);
        evas_object_resize(pWinObject, winBounds.width, winBounds.height);
 
+       SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x] Set bounds(rot = %d, %d, %d, %d, %d).", win, rotate, winX, winY, winBounds.width, winBounds.height);
+
        SetLastResult(E_SUCCESS);
 }
 
index 5d81bfa..c308301 100644 (file)
@@ -425,8 +425,10 @@ _OrientationAgent::UpdateOrientation(void)
        {
                pEcoreEvas->UpdateWindowBounds(*pRootWindow);
                
+               pImpl->Invalidate(true);
+
                Rectangle bounds = pRootWindow->GetBounds();
-               SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x, %d, %d, %d, %d] Update evas objects to %d degree.", 
+               SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x, %d, %d, %d, %d] Update VEs to %d degree.", 
                        pRootWindow->GetNativeHandle(), bounds.x, bounds.y, bounds.width, bounds.height, rotation);
        }
 }
@@ -475,6 +477,16 @@ _OrientationAgent::FireOrientationEvent(void)
                IEventArg* pArg = _PublicOrientationEvent::CreateOrientationEventArgN(*__pPublicEvent->GetSource(), __status);
                __pPublicEvent->Fire(*pArg);
 
+               _ControlImpl* pImpl = _ControlImpl::GetInstance(__publicControl);
+               if (pImpl)
+               {
+                       _Window* pWindow = pImpl->GetCore().GetRootWindow();
+                       if (pWindow)
+                       {
+                               SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x] Fire the public orientation event..", pWindow->GetNativeHandle());
+                       }
+               }
+
                __updateStatus = true;
        }
 }
@@ -525,6 +537,12 @@ _OrientationAgent::FireEvent(OrientationStatus status)
                IEventArg* pArg = _PublicOrientationEvent::CreateOrientationEventArgN(*__pPublicEvent->GetSource(), status);
                __pPublicEvent->Fire(*pArg);
 
+               _Window* pWindow = pImpl->GetCore().GetRootWindow();
+               if (pWindow)
+               {
+                       SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x] Fire the public orientation event..", pWindow->GetNativeHandle());
+               }
+
                __updateStatus = true;
        }
 }
index ccc29cb..060f25e 100644 (file)
@@ -279,6 +279,10 @@ _ContextMenu::OnAttachedToMainTree(void)
 {
        result r = E_SUCCESS;
 
+#if defined(WINDOW_BASE_ROTATE)
+       __layout = _ControlManager::GetInstance()->GetOrientation();
+#endif
+
        if (GetOwner() == null)
        {
                _Frame* pFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame());
@@ -287,7 +291,9 @@ _ContextMenu::OnAttachedToMainTree(void)
                _Form* pForm = pFrame->GetCurrentForm();
                pForm != null ? SetOwner(pForm) : SetOwner(pFrame);
 
+#if !defined(WINDOW_BASE_ROTATE)
                __layout = _ControlManager::GetInstance()->GetOrientation();
+#endif
                GET_SHAPE_CONFIG(CONTEXTMENU::ITEM_MAX_COUNT, __layout, __showItemMaxCount);
        }