Fix the rotation of Frame
authorChoi Munseok <ms47.choi@samsung.com>
Wed, 3 Apr 2013 07:03:00 +0000 (16:03 +0900)
committerChoi Munseok <ms47.choi@samsung.com>
Wed, 3 Apr 2013 07:03:00 +0000 (16:03 +0900)
Change-Id: I151559a2ea32536a91cef6edc3eac8185708e78a
Signed-off-by: Choi Munseok <ms47.choi@samsung.com>
src/ui/FUi_OrientationAgent.cpp
src/ui/controls/FUiCtrl_Frame.cpp
src/ui/controls/FUiCtrl_FrameImpl.cpp
src/ui/inc/FUiCtrl_Frame.h

index f33c904..b10c828 100644 (file)
@@ -188,8 +188,15 @@ _OrientationAgent::Update(bool draw)
                // Rotate screen
                // Set preffered rotation
 
+               _Window* pWindow = pImpl->GetCore().GetRootWindow();
+               NativeWindowHandle handle = 0;
+               if (pWindow)
+               {
+                       handle = pWindow->GetNativeHandle();
+               }
+
                OrientationStatus status = pImplManager->GetOrientationStatus(__mode);
-               SysLog(NID_UI, "[Window Manager Rotation] Update : __mode(%d) -> status(%d)", __mode, status);
+               SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x] Update : __mode(%d) -> status(%d)", handle, __mode, status);
                
                if (__updateStatus == true)
                {
index 5d6f048..409506f 100644 (file)
@@ -60,6 +60,7 @@ _Frame::_Frame(void)
        , __minimized(false)
        , __activated(false)
        , __constructed(false)
+       , __rotation(false)
        , __pFormActivationChangeEventListener(null)
 {
        _FramePresenter* pPresenter = new (std::nothrow) _FramePresenter(*this);
@@ -409,6 +410,12 @@ _Frame::IsOrientationRoot(void) const
 }
 
 void
+_Frame::SetRotation(bool rotation)
+{
+       __rotation = rotation;
+}
+
+void
 _Frame::AddFrameEventListener(const _IFrameEventListener& listener)
 {
        __constructed = true;
@@ -628,7 +635,14 @@ _Frame::OnBoundsChanging(const FloatRectangle& bounds)
                }
                else
                {
-                       return E_UNSUPPORTED_OPERATION;
+                       if (__rotation == true)
+                       {
+                               return E_SUCCESS;
+                       }
+                       else
+                       {
+                               return E_UNSUPPORTED_OPERATION;
+                       }
                }
        }
 
index efc339f..843e62a 100644 (file)
@@ -306,6 +306,8 @@ _FrameImpl::OnChangeLayout(_ControlOrientation orientation)
 
        if (frameShowMode == FRAME_SHOW_MODE_FULL_SCREEN)
        {
+               GetCore().SetRotation(true);
+       
                if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
                {
                        SetSize(screenSize);
@@ -314,6 +316,8 @@ _FrameImpl::OnChangeLayout(_ControlOrientation orientation)
                {
                        SetSize(FloatDimension(screenSize.height, screenSize.width));
                }
+
+               GetCore().SetRotation(false);
        }
        else if ((frameShowMode == FRAME_SHOW_MODE_PARTIAL_SCREEN) || (frameShowMode == FRAME_SHOW_MODE_PARTIAL_SCREEN_FLOATING))
        {
index 10eddbb..f40114f 100644 (file)
@@ -74,6 +74,7 @@ public:
 
 // Orientation
        virtual bool IsOrientationRoot(void) const;
+       void SetRotation(bool rotation);
 
 // Event listeners
        void AddFrameEventListener(const Tizen::Ui::Controls::_IFrameEventListener& listener);
@@ -108,6 +109,7 @@ private:
        bool __minimized;
        bool __activated;
        bool __constructed;
+       bool __rotation;
        _IFormActivationChangeEventListener* __pFormActivationChangeEventListener;
 }; // _Frame