Revert "fix window rotation to decide orientation timing"
authorSeungwanWoo <s-w.woo@samsung.com>
Tue, 26 Mar 2013 17:46:21 +0000 (02:46 +0900)
committerGerrit Code Review <gerrit2@kim11>
Tue, 26 Mar 2013 17:46:37 +0000 (02:46 +0900)
This reverts commit 1ef704381b7ee415436d9f71127d88d9df773728

src/ui/FUi_OrientationAgent.cpp [changed mode: 0755->0644]
src/ui/FUi_OrientationAgent.h [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 16e6a34..c308301
@@ -74,7 +74,6 @@ _OrientationAgent::_OrientationAgent(Control& publicControl)
        , __pPublicEvent(null)
        , __mode(ORIENTATION_PORTRAIT)
        , __status(ORIENTATION_STATUS_PORTRAIT)
-       , __tempStatus(ORIENTATION_STATUS_PORTRAIT)
        , __firePublicEvent(false)
        , __statusChanged(false)
        , __updateStatus(true)
@@ -210,46 +209,6 @@ _OrientationAgent::Update(bool draw)
                                }
                        }
                }
-               else
-               {
-                       switch (__mode)
-                       {
-                       case ORIENTATION_PORTRAIT:
-                               {
-                               __draw = draw;
-                               __tempStatus = ORIENTATION_STATUS_PORTRAIT;
-                               UpdateOrientation(true);
-                               }
-                               break;
-                       case ORIENTATION_LANDSCAPE:
-                               {
-                               __draw = draw;
-                               __tempStatus = ORIENTATION_STATUS_LANDSCAPE;
-                               UpdateOrientation(true);
-                               SysLog(NID_UI, "Window Manager Rotation");
-                               }
-                               break;
-                       case ORIENTATION_PORTRAIT_REVERSE:
-                               {
-                               __draw = draw;
-                               __tempStatus = ORIENTATION_STATUS_PORTRAIT_REVERSE;
-                               UpdateOrientation(true);
-                               }
-                               break;
-                       case ORIENTATION_LANDSCAPE_REVERSE:
-                               {
-                               __draw = draw;
-                               __tempStatus = ORIENTATION_STATUS_LANDSCAPE_REVERSE;
-                               UpdateOrientation(true);
-                               }
-                               break;
-                       default:
-                               {
-                               SysLog(NID_UI, "Window Manager Rotation Default");
-                               }
-                               break;
-                       }
-               }
        }
        else
        {
@@ -394,7 +353,7 @@ _OrientationAgent::Update(bool draw)
 
 #if defined(WINDOW_BASE_ROTATE)
 void
-_OrientationAgent::UpdateOrientation(bool force)
+_OrientationAgent::UpdateOrientation(void)
 {
        _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
        if (!pEcoreEvas)
@@ -408,13 +367,7 @@ _OrientationAgent::UpdateOrientation(bool force)
                return;
        }
 
-       int rotation = 0;
-
-       _Window* pWindow = pImpl->GetCore().GetRootWindow();
-       if (pWindow)
-       {
-               rotation = pEcoreEvas->GetWindowRotation(*pWindow);
-       }
+       int rotation = pEcoreEvas->GetWindowRotation(*(pImpl->GetCore().GetRootWindow()));
 
        // Update evas objects.
        OrientationStatus status = ORIENTATION_STATUS_NONE;
@@ -436,11 +389,6 @@ _OrientationAgent::UpdateOrientation(bool force)
                break;
        }
 
-       if (force)
-       {
-               status = __tempStatus;
-       }
-
        if (__updateStatus == true)
        {
                __statusChanged = false;
@@ -618,72 +566,40 @@ _OrientationAgent::SetRotation(const _Window& window, Orientation orientation)
        switch (orientation)
        {
        case ORIENTATION_PORTRAIT:
+               pEcoreEvas->SetWindowPreferredRotation(window, 0);
+               
+               if ((deviceOrientation == 0) || (windowRotation == 0))
                {
-                       pEcoreEvas->SetWindowPreferredRotation(window, 0);
-
-                       __tempStatus = ORIENTATION_STATUS_PORTRAIT;
-                       UpdateOrientation(true);
-
-                       return;
-       
-                       /*
-                       if ((deviceOrientation == 0) || (windowRotation == 0))
-                       {
-                               callback = false;
-                       }
-                       */
+                       callback = false;
                }
+               
                break;
        case ORIENTATION_LANDSCAPE:
+               pEcoreEvas->SetWindowPreferredRotation(window, 270);
+               
+               if ((deviceOrientation == 270) || (windowRotation == 270))
                {
-                       pEcoreEvas->SetWindowPreferredRotation(window, 270);
-
-                       __tempStatus = ORIENTATION_STATUS_LANDSCAPE;
-                       UpdateOrientation(true);
-
-                       return;
-
-                       /*
-                       if ((deviceOrientation == 270) || (windowRotation == 270))
-                       {
-                               callback = false;
-                       }
-                       */
+                       callback = false;
                }
+               
                break;
        case ORIENTATION_PORTRAIT_REVERSE:
-               {
-                       pEcoreEvas->SetWindowPreferredRotation(window, 180);
+               pEcoreEvas->SetWindowPreferredRotation(window, 180);
                
-                       __tempStatus = ORIENTATION_STATUS_PORTRAIT_REVERSE;
-                       UpdateOrientation(true);
-                       
-                       return;
-
-                       /*
-                       if ((deviceOrientation == 180) || (windowRotation == 180))
-                       {
-                               callback = false;
-                       }
-                       */
+               if ((deviceOrientation == 180) || (windowRotation == 180))
+               {
+                       callback = false;
                }
+               
                break;
        case ORIENTATION_LANDSCAPE_REVERSE:
+               pEcoreEvas->SetWindowPreferredRotation(window, 90);
+               
+               if ((deviceOrientation == 90) || (windowRotation == 90))
                {
-                       pEcoreEvas->SetWindowPreferredRotation(window, 90);
-                       
-                       __tempStatus = ORIENTATION_STATUS_LANDSCAPE_REVERSE;
-                       UpdateOrientation(true);
-                       
-                       return;
-
-                       /*              
-                       if ((deviceOrientation == 90) || (windowRotation == 90))
-                       {
-                               callback = false;
-                       }
-                       */
+                       callback = false;
                }
+               
                break;
        case ORIENTATION_AUTOMATIC:
                {
old mode 100755 (executable)
new mode 100644 (file)
index 39b3263..e858eec
@@ -52,7 +52,7 @@ public:
 
        void Update(bool draw = false);
 #if defined(WINDOW_BASE_ROTATE)
-       void UpdateOrientation(bool force = false);
+       void UpdateOrientation(void);
 #endif
 
        void RequestOrientationEvent(void);
@@ -74,7 +74,6 @@ private:
        _PublicOrientationEvent* __pPublicEvent;
        Orientation __mode;
        OrientationStatus __status;
-       OrientationStatus __tempStatus;
        bool __firePublicEvent;
        bool __statusChanged;
        bool __updateStatus;