Changed to get prefer ROT
[platform/framework/native/uifw.git] / src / ui / FUi_EcoreEvas.cpp
index dc6fd54..2f69919 100644 (file)
@@ -61,6 +61,9 @@
 #include "FUi_ControlImplManager.h"
 #include "FUiCtrl_Popup.h"
 #include "FUiCtrl_ContextMenu.h"
+#include "FUiAnim_DisplayContextImpl.h"
+#include "FUiAnimDisplayContext.h"
+#include "FUi_TouchManager.h"
 
 using namespace Tizen::Base;
 using namespace Tizen::Base::Runtime;
@@ -92,7 +95,6 @@ namespace
 {
 
 Ecore_X_Atom __atomRotateRootAngle = 0;
-Ecore_X_Atom __atomAccessibility = 0;
 
 int __clipboardHeight = 0;
 
@@ -107,12 +109,12 @@ OnWindowStateChanged(Ecore_Evas* pEcoreEvas)
 
        Ecore_X_Window targetWin = (Ecore_X_Window) ecore_evas_window_get(pEcoreEvas);
 
-       SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x] OnWindowStateChanged is called.", targetWin);
+       SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] OnWindowStateChanged is called.", targetWin);
 
-       int winCount = pControlManager->GetWindowCount();
+       int winCount = pControlManager->GetAllWindowCount();
        for (int i = 0; i < winCount; i++)
        {
-               _Window* pWindow = pControlManager->GetWindow(i);
+               _Window* pWindow = pControlManager->GetAllWindow(i);
                if (!pWindow)
                {
                        continue;
@@ -228,17 +230,23 @@ OnWindowPropertyChanged(void* pData, int type, void* pEvent)
                        if (pWindow->IsOrientationRoot() == true)
                        {
                                _Frame* pFrame = static_cast<_Frame*>(pWindow);
+                               _DisplayContextImpl* pContext = _DisplayContextImpl::GetInstance(*pFrame->GetDisplayContext());
+                               _EflLayer* pLayer = static_cast<_EflLayer*>(pContext->GetNativeLayer());
+
 
                                Ecore_X_Window_State_Hint state = ecore_x_icccm_state_get(targetWin);
                                switch (state)
                                {
                                case ECORE_X_WINDOW_STATE_HINT_WITHDRAWN:
+                                       pLayer->SetRenderNeeded(false);
                                        // Frame was hidden.
                                        break;
                                case ECORE_X_WINDOW_STATE_HINT_ICONIC:
+                                       pLayer->SetRenderNeeded(false);
                                        pFrame->OnFrameMinimized();
                                        break;
                                case ECORE_X_WINDOW_STATE_HINT_NORMAL:
+                                       pLayer->SetRenderNeeded(true);
                                        pFrame->OnFrameRestored();
                                        break;
                                default:
@@ -327,32 +335,140 @@ CATCH:
        return EINA_FALSE;
 }
 
+int frameX = 0;
+int frameY = 0;
+int frameW = 0;
+int frameH = 0;
+
 Eina_Bool
-OnWindowShown(void* pData, int type, void* pEvent)
+OnWindowConfigured(void* pData, int type, void* pEvent)
 {
+       Ecore_X_Event_Window_Configure* pEv = (Ecore_X_Event_Window_Configure*)pEvent;
+       if (!pEv)
+       {
+               return ECORE_CALLBACK_PASS_ON;
+       }
+
+       if (pEv->from_wm == EINA_FALSE)
+       {
+               return ECORE_CALLBACK_PASS_ON;
+       }
+
+       Ecore_X_Window targetWin = pEv->win;
+       if (targetWin == 0)
+       {
+               return ECORE_CALLBACK_PASS_ON;
+       }
+
+       if ((frameX == pEv->x) && (frameY == pEv->y) && (frameW == pEv->w) && (frameH == pEv->h))
+       {
+               return ECORE_CALLBACK_PASS_ON;
+       }
+
+       frameX = pEv->x;
+       frameY = pEv->y;
+       frameW = pEv->w;
+       frameH = pEv->h;
+
+       _ControlManager* pControlManager = _ControlManager::GetInstance();
+       if (!pControlManager)
+       {
+               return ECORE_CALLBACK_PASS_ON;
+       }
+
+       _TouchManager* pTouchManager = _TouchManager::GetInstance();
+       if (!pTouchManager)
+       {
+               return ECORE_CALLBACK_PASS_ON;
+       }
+
+       if (pTouchManager->GetPointCount() > 0)
+       {
+               return ECORE_CALLBACK_PASS_ON;
+       }
+
+       _Window* pWindow = pControlManager->GetCurrentFrame();
+       if (!pWindow)
+       {
+               return ECORE_CALLBACK_PASS_ON;
+       }
+
+       if (pWindow->IsOrientationRoot() == false)
+       {
+               return ECORE_CALLBACK_PASS_ON;
+       }
+
+       _Frame* pFrame = static_cast<_Frame*>(pWindow);
+       if (pFrame->GetShowMode() == FRAME_SHOW_MODE_FULL_SCREEN)
+       {
+               return ECORE_CALLBACK_PASS_ON;
+       }
+
+       Ecore_X_Window win = (Ecore_X_Window)pFrame->GetNativeHandle();
+       if (win != targetWin)
+       {
+               return ECORE_CALLBACK_PASS_ON;
+       }
+
+       _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
+       if (!pEcoreEvas)
+       {
+               return ECORE_CALLBACK_PASS_ON;
+       }
+
+       Rectangle frameBounds = pFrame->GetBounds();
+       int rotation = pEcoreEvas->GetWindowRotation(*pFrame);
+
+       Dimension winSize = _CoordinateSystemUtils::InverseTransform(Dimension(pEv->w, pEv->h));
+       Dimension newSize(winSize.width, winSize.height);
+       if ((rotation == 270) || (rotation == 90))
+       {
+               newSize.width = winSize.height;
+               newSize.height = winSize.width;
+       }
+
+       if ((frameBounds.width != newSize.width) || (frameBounds.height != newSize.height))
+       {
+               return ECORE_CALLBACK_PASS_ON;
+       }
+
+       Dimension screenSize = pControlManager->GetScreenSize();
+       Point winPosition = _CoordinateSystemUtils::InverseTransform(Point(pEv->x, pEv->y));
+
+       Point newPosition(0, 0);
+       switch (rotation)
+       {
+       case 270:
+               newPosition.x = winPosition.y;
+               newPosition.y = screenSize.width - winPosition.x - frameBounds.height;
+               break;
+       case 180:
+               newPosition.x = screenSize.width - winPosition.x - frameBounds.width;
+               newPosition.y = screenSize.height - winPosition.y - frameBounds.height;
+               break;
+       case 90:
+               newPosition.x = screenSize.height - winPosition.y - frameBounds.width;
+               newPosition.y = winPosition.x;
+               break;
+       default:
+               newPosition.x = winPosition.x;
+               newPosition.y = winPosition.y;
+               break;
+       }
+
+       if ((frameBounds.x != newPosition.x) || (frameBounds.y != newPosition.y))
+       {
+               pFrame->SetChangingBoundsEnabled(false);
+               pFrame->SetPosition(newPosition);
+               pFrame->SetChangingBoundsEnabled(true);
+       }
+
        return ECORE_CALLBACK_PASS_ON;
 }
 
 Eina_Bool
-OnAccessibilitySettingMessageReceived(void* pData, int type, void* pEvent)
+OnWindowShown(void* pData, int type, void* pEvent)
 {
-       Ecore_X_Event_Client_Message* pClientEvent = static_cast<Ecore_X_Event_Client_Message*>(pEvent);
-       if (pClientEvent->message_type == __atomAccessibility)
-       {
-               if ((Eina_Bool)pClientEvent->data.l[0])
-               {
-                       _AccessibilitySystemSettingLoader::SetSystemSetting(L"AccessibilityActivationStatus", true);
-                       _AccessibilitySystemSettingLoader::SetSystemSetting(L"AccessibilityActivationStatus", true);
-                       SysLog(NID_UI, "Accessibility Screen reader is activated.");
-
-               }
-               else
-               {
-                       _AccessibilitySystemSettingLoader::SetSystemSetting(L"AccessibilityActivationStatus", false);
-                       _AccessibilitySystemSettingLoader::SetSystemSetting(L"AccessibilityActivationStatus", false);
-                       SysLog(NID_UI, "Accessibility Screen reader is deactivated.");
-               }
-       }
        return ECORE_CALLBACK_PASS_ON;
 }
 
@@ -460,6 +576,24 @@ OnClientMessageReceived(void* pData, int type, void* pEvent)
                                _AccessibilityGesture::ProcessGesture(_ACCESSIBILITY_GESTURE_TYPE_TWO_FINGER_PANNING_FINISHED, x, y);
                        }
                }
+               else if ((unsigned int)pClientEvent->data.l[1] == ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_SCROLL)
+               {
+                       SysLog(NID_UI, "Accessibility action : scroll %d, %d, %d", pClientEvent->data.l[2], pClientEvent->data.l[3], pClientEvent->data.l[4]);
+                       x = (Evas_Coord)pClientEvent->data.l[3];
+                       y = (Evas_Coord)pClientEvent->data.l[4];
+                       if (pClientEvent->data.l[2] == 0)
+                       {
+                               _AccessibilityGesture::ProcessGesture(_ACCESSIBILITY_GESTURE_TYPE_TWO_FINGER_PANNING_STARTED, x, y);
+                       }
+                       else if (pClientEvent->data.l[2] == 1)
+                       {
+                               _AccessibilityGesture::ProcessGesture(_ACCESSIBILITY_GESTURE_TYPE_TWO_FINGER_PANNING_CHANGED, x, y);
+                       }
+                       else if (pClientEvent->data.l[2] == 2)
+                       {
+                               _AccessibilityGesture::ProcessGesture(_ACCESSIBILITY_GESTURE_TYPE_TWO_FINGER_PANNING_FINISHED, x, y);
+                       }
+               }
                else if ((unsigned int)pClientEvent->data.l[1] == ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_DOWN)
                {
                        SysLog(NID_UI, "Accessibility action : value decreased");
@@ -1055,6 +1189,7 @@ _EcoreEvas::_EcoreEvas(void)
        : __pWindowVisibilityChanged(null)
        , __pWindowPropertyChanged(null)
        , __pWindowShown(null)
+       , __pWindowConfigured(null)
        , __pClientMessageReceived(null)
        , __pClearClip(null)
        , __pNotifyClip(null)
@@ -1066,7 +1201,7 @@ _EcoreEvas::_EcoreEvas(void)
        , __openClipboard(false)
 {
        int ret = appcore_unset_rotation_cb();
-       SysLog(NID_UI, "[Window Manager Rotation] appcore_unset_rotation_cb = %d", ret);
+       SysLog(NID_UI, "[WM ROTATION] appcore_unset_rotation_cb = %d", ret);
 
        __pWindowVisibilityChanged = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_VISIBILITY_CHANGE, OnWindowVisibilityChanged, (void*) this);
        SysTryReturnVoidResult(NID_UI, __pWindowVisibilityChanged, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
@@ -1074,7 +1209,6 @@ _EcoreEvas::_EcoreEvas(void)
        __pClientMessageReceived = ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, OnClientMessageReceived, NULL);
 
        ecore_x_event_mask_set(ecore_x_window_root_first_get(), ECORE_X_EVENT_MASK_WINDOW_CONFIGURE);
-       ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, OnAccessibilitySettingMessageReceived, NULL);
        ecore_x_event_mask_set(ecore_x_window_root_first_get(), ECORE_X_EVENT_MASK_WINDOW_PROPERTY);
 
        _pEvas = this;
@@ -1091,6 +1225,9 @@ _EcoreEvas::_EcoreEvas(void)
        __pWindowShown = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_SHOW, OnWindowShown, (void*) this);
        SysTryCatch(NID_UI, __pWindowShown, , E_SYSTEM, "[E_SYSTEM] A system error occurred.");
 
+       __pWindowConfigured = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_CONFIGURE, OnWindowConfigured, NULL);
+       SysTryCatch(NID_UI, __pWindowConfigured, , E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+
        __pWindowPropertyChanged = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY, OnWindowPropertyChanged, NULL);
        SysTryCatch(NID_UI, __pWindowPropertyChanged, , E_SYSTEM, "[E_SYSTEM] A system error occurred.");
 
@@ -1110,6 +1247,12 @@ CATCH:
                ecore_event_handler_del(__pWindowShown);
                __pWindowShown = null;
        }
+
+       if (__pWindowConfigured)
+       {
+               ecore_event_handler_del(__pWindowConfigured);
+               __pWindowConfigured = null;
+       }
 }
 
 _EcoreEvas::~_EcoreEvas(void)
@@ -1126,6 +1269,12 @@ _EcoreEvas::~_EcoreEvas(void)
                __pWindowShown = null;
        }
 
+       if (__pWindowConfigured)
+       {
+               ecore_event_handler_del(__pWindowConfigured);
+               __pWindowConfigured = null;
+       }
+
        if (__pClientMessageReceived)
        {
                ecore_event_handler_del(__pClientMessageReceived);
@@ -1207,7 +1356,6 @@ _EcoreEvas::RotateWindow(const _Window& window, int orientation, bool rotateEvas
                rotatePartial = false;
        }
 
-       Evas_Object* pWinObj = pLayer->GetElmWin();
        Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pEcoreEvas);
 
        int rootW = 0;
@@ -1219,20 +1367,19 @@ _EcoreEvas::RotateWindow(const _Window& window, int orientation, bool rotateEvas
                if (rotateEvas == true)
                {
                        ecore_evas_rotation_with_resize_set(pEcoreEvas, orientation);
-               }
 
-               evas_object_move(pWinObj, 0, 0);
 
-               if ((orientation == 0) || (orientation == 180))
-               {
-                       evas_object_resize(pWinObj, rootW, rootH);
-               }
-               else
-               {
-                       evas_object_resize(pWinObj, rootH, rootW);
-               }
+                       if ((orientation == 0) || (orientation == 180))
+                       {
+                               pLayer->SetBounds(FloatRectangle(0, 0, rootW, rootH));
+                       }
+                       else
+                       {
+                               pLayer->SetBounds(FloatRectangle(0, 0, rootH, rootW));
+                       }
 
-               SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x, FULL SCREEN] Rotate bounds(rot = %d).", win, orientation);
+                       SysLog(NID_UI, "[WM ROTATION][WIN 0x%x, FULL SCREEN] Rotate bounds(ROT %d).", win, orientation);
+               }
        }
        else
        {
@@ -1244,7 +1391,6 @@ _EcoreEvas::RotateWindow(const _Window& window, int orientation, bool rotateEvas
                Rectangle winBounds = _CoordinateSystemUtils::Transform(window.GetBounds());
                int rotate = ecore_evas_rotation_get(pEcoreEvas);
 
-
                int winX = winBounds.x;
                int winY = winBounds.y;
 
@@ -1272,16 +1418,16 @@ _EcoreEvas::RotateWindow(const _Window& window, int orientation, bool rotateEvas
                int h = 0;
                Eina_Bool ret = ecore_x_e_window_rotation_geometry_get(win, rotate, &x, &y, &w, &h);
 
-               evas_object_move(pWinObj, winX, winY);
 
                if (ret == EINA_FALSE)
                {
-                       evas_object_resize(pWinObj, winBounds.width, winBounds.height);
-                       SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x, PARTIAL SCREEN] Rotate bounds(rot = %d, %d, %d, %d, %d).", win, orientation, winX, winY, winBounds.width, winBounds.height);
+                       pLayer->SetBounds(FloatRectangle(winX, winY, winBounds.width, winBounds.height));
+                       SysLog(NID_UI, "[WM ROTATION][WIN 0x%x, PARTIAL SCREEN] Rotate bounds(ROT %d, %d, %d, %d, %d).", win, orientation, winX, winY, winBounds.width, winBounds.height);
                }
                else
                {
-                       SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x, PARTIAL SCREEN] Rotate bounds(rot = %d, %d, %d) ONLY MOVE.", win, orientation, winX, winY);
+                       pLayer->SetBounds(FloatRectangle(winX, winY, w, h));
+                       SysLog(NID_UI, "[WM ROTATION][WIN 0x%x, PARTIAL SCREEN] Rotate bounds(ROT %d, %d, %d) ONLY MOVE.", win, orientation, winX, winY);
                }
        }
 }
@@ -1390,10 +1536,13 @@ _EcoreEvas::GetProcessId(unsigned int window)
 void
 _EcoreEvas::SetOwner(NativeWindowHandle ownee, NativeWindowHandle owner)
 {
-       ecore_x_icccm_transient_for_unset(ownee);
-       ecore_x_icccm_transient_for_set(ownee, owner);
-
-       SysLog(NID_UI, "[Window Order Group][Window : 0x%x] transient_for_set -> 0x%x", ownee, owner);
+       Ecore_X_Window win = ecore_x_icccm_transient_for_get(ownee);
+       if (win != owner)
+       {
+               ecore_x_icccm_transient_for_unset(ownee);
+               ecore_x_icccm_transient_for_set(ownee, owner);
+               SysLog(NID_UI, "[WIN ORDER][WIN 0x%x] transient_for_set -> 0x%x", ownee, owner);
+       }
 }
 
 void
@@ -1656,6 +1805,25 @@ _EcoreEvas::IsClipboardOpened(void)
        return __openClipboard;
 }
 
+String
+_EcoreEvas::ConvertMarkupToUtf8(const String& string)
+{
+       char* pChar = _Clipboard::GetInstance()->EncodeToCharN(string);
+       if (!pChar)
+       {
+               return String(L"");
+       }
+
+       char* pTempChar = evas_textblock_text_markup_to_utf8(NULL, pChar);
+       SysLog(NID_UI, "[Clipboard] markup[%s] -> utf8[%s]", pChar, pTempChar);
+       free(pChar);
+
+       String str(pTempChar);
+       free(pTempChar);
+
+       return str;
+}
+
 result
 _EcoreEvas::SetEventPropagation(const _Control& control, bool enable)
 {
@@ -2111,20 +2279,24 @@ _EcoreEvas::SetWindowLevel(const _Window& window, _WindowLevel level)
 
        Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pEcoreEvas);
        ecore_x_icccm_transient_for_unset(win);
+       SysLog(NID_UI, "[WIN ORDER][WIN 0x%x] transient_for_unset", win);
 
        if (level == _WINDOW_LEVEL_NORMAL)
        {
                ecore_x_netwm_window_type_set(win, ECORE_X_WINDOW_TYPE_NORMAL);
+               SysLog(NID_UI, "[WIN ORDER][WIN 0x%x] set : ECORE_X_WINDOW_TYPE_NORMAL", win);
        }
        else if (level == _WINDOW_LEVEL_NOTIFICATION_HIGH)
        {
                ecore_x_netwm_window_type_set(win, ECORE_X_WINDOW_TYPE_NOTIFICATION);
                utilx_set_system_notification_level((Display*)ecore_x_display_get(), win, UTILX_NOTIFICATION_LEVEL_HIGH);
+               SysLog(NID_UI, "[WIN ORDER][WIN 0x%x] set : ECORE_X_WINDOW_TYPE_NOTIFICATION, UTILX_NOTIFICATION_LEVEL_HIGH", win);
        }
        else if (level == _WINDOW_LEVEL_NOTIFICATION_MIDDLE)
        {
                ecore_x_netwm_window_type_set(win, ECORE_X_WINDOW_TYPE_NOTIFICATION);
                utilx_set_system_notification_level((Display*)ecore_x_display_get(), win, UTILX_NOTIFICATION_LEVEL_NORMAL);
+               SysLog(NID_UI, "[WIN ORDER][WIN 0x%x] set : ECORE_X_WINDOW_TYPE_NOTIFICATION, UTILX_NOTIFICATION_LEVEL_NORMAL", win);
        }
 
        SetLastResult(E_SUCCESS);
@@ -2189,15 +2361,11 @@ _EcoreEvas::SetWindowBounds(const _Window& window, const Rectangle& bounds)
 
        int rotate = ecore_evas_rotation_get(pEcoreEvas);
 
-       _Window* pWindow = const_cast<_Window*>(&window);
-
-       _ContextMenu* pContextMenu = dynamic_cast<_ContextMenu*>(pWindow);
-       if (pContextMenu)
+//     _Window* pWindow = const_cast<_Window*>(&window);
+//     _ContextMenu* pContextMenu = dynamic_cast<_ContextMenu*>(pWindow);
+//     if (pContextMenu)
+       if ((window.IsOrientationRoot() == false) && (window.IsRotationSynchronized() == false))
        {
-               // [Exception]
-               // ContextMenu
-               // Skip
-
                _ControlManager* pControlManager = _ControlManager::GetInstance();
                if (pControlManager)
                {
@@ -2244,16 +2412,16 @@ _EcoreEvas::SetWindowBounds(const _Window& window, const Rectangle& bounds)
        int h = 0;
        Eina_Bool ret = ecore_x_e_window_rotation_geometry_get(win, rotate, &x, &y, &w, &h);
 
-       evas_object_move(pWinObject, winX, winY);
 
        if (ret == EINA_FALSE)
        {
-               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);
+               pLayer->SetBounds(FloatRectangle(winX, winY, winBounds.width, winBounds.height));
+               SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] Set bounds(ROT %d, %d, %d, %d, %d).", win, rotate, winX, winY, winBounds.width, winBounds.height);
        }
        else
        {
-               SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x] Set bounds(rot = %d, %d, %d) ONLY MOVE.", win, rotate, winX, winY);
+               pLayer->SetBounds(FloatRectangle(winX, winY, w, h));
+               SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] Set bounds(ROT %d, %d, %d, %d, %d) ONLY MOVE.", win, rotate, winX, winY, w, h);
        }
 
        SetLastResult(E_SUCCESS);
@@ -2281,15 +2449,11 @@ _EcoreEvas::SetWindowBounds(const _Window& window, const FloatRectangle& bounds)
 
        int rotate = ecore_evas_rotation_get(pEcoreEvas);
 
-       _Window* pWindow = const_cast<_Window*>(&window);
-
-       _ContextMenu* pContextMenu = dynamic_cast<_ContextMenu*>(pWindow);
-       if (pContextMenu)
+//     _Window* pWindow = const_cast<_Window*>(&window);
+//     _ContextMenu* pContextMenu = dynamic_cast<_ContextMenu*>(pWindow);
+//     if (pContextMenu)
+       if ((window.IsOrientationRoot() == false) && (window.IsRotationSynchronized() == false))
        {
-               // [Exception]
-               // ContextMenu
-               // Skip
-
                _ControlManager* pControlManager = _ControlManager::GetInstance();
                if (pControlManager)
                {
@@ -2336,16 +2500,16 @@ _EcoreEvas::SetWindowBounds(const _Window& window, const FloatRectangle& bounds)
        int h = 0;
        Eina_Bool ret = ecore_x_e_window_rotation_geometry_get(win, rotate, &x, &y, &w, &h);
 
-       evas_object_move(pWinObject, winX, winY);
 
        if (ret == EINA_FALSE)
        {
-               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);
+               pLayer->SetBounds(FloatRectangle(winX, winY, winBounds.width, winBounds.height));
+               SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] Set bounds(ROT %d, %d, %d, %d, %d).", win, rotate, winX, winY, winBounds.width, winBounds.height);
        }
        else
        {
-               SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x] Set bounds(rot = %d, %d, %d) ONLY MOVE.", win, rotate, winX, winY);
+               pLayer->SetBounds(FloatRectangle(winX, winY, w, h));
+               SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] Set bounds(ROT %d, %d, %d, %d, %d) ONLY MOVE.", win, rotate, winX, winY, w, h);
        }
 
        SetLastResult(E_SUCCESS);
@@ -2384,13 +2548,17 @@ _EcoreEvas::SetOwner(const _Window& ownee, const _Control& owner)
        ecore_x_netwm_window_type_get(owneeWin, &type);
        if ((type == ECORE_X_WINDOW_TYPE_NORMAL) || (type == ECORE_X_WINDOW_TYPE_UTILITY))
        {
-               ecore_x_icccm_transient_for_unset(owneeWin);
-               ecore_x_icccm_transient_for_set(owneeWin, ownerWin);
-               SysLog(NID_UI, "[Window Order Group][Window : 0x%x] transient_for_set -> 0x%x", owneeWin, ownerWin);
+               Ecore_X_Window win = ecore_x_icccm_transient_for_get(owneeWin);
+               if (win != ownerWin)
+               {
+                       ecore_x_icccm_transient_for_unset(owneeWin);
+                       ecore_x_icccm_transient_for_set(owneeWin, ownerWin);
+                       SysLog(NID_UI, "[WIN ORDER][WIN 0x%x] transient_for_set -> 0x%x", owneeWin, ownerWin);
+               }
        }
        else
        {
-               SysLog(NID_UI, "[Window Order Group][Window : 0x%x] Skip to transient_for_set", owneeWin);
+               SysLog(NID_UI, "[WIN ORDER][WIN 0x%x] Skip to transient_for_set", owneeWin);
        }
 
        // Ownee window
@@ -2416,7 +2584,9 @@ _EcoreEvas::SetOwner(const _Window& ownee, const _Control& owner)
                bool preferredRoation = pOwnerWindow->GetPreferredRotation();
                if (preferredRoation == true)
                {
-                       int preferredRotation = ecore_evas_wm_rotation_preferred_rotation_get(pOwnerLayer->GetEcoreEvas());
+                       //int preferredRotation = ecore_evas_wm_rotation_preferred_rotation_get(pOwnerLayer->GetEcoreEvas());
+                       int preferredRotation = 0;
+                       ecore_x_e_window_rotation_preferred_rotation_get(ownerWin, &preferredRotation);
                        SetWindowPreferredRotation(ownee, preferredRotation);
                }
                else
@@ -2447,7 +2617,7 @@ _EcoreEvas::GetWindowRotation(const _Window& window)
 }
 
 void
-_EcoreEvas::SetWindowPreferredRotation(const _Window& window, int rotation)
+_EcoreEvas::SetWindowPreferredRotation(const _Window& window, int rotation, bool force)
 {
        _EflLayer* pLayer = GetEflLayer(window);
        if (!pLayer)
@@ -2456,7 +2626,12 @@ _EcoreEvas::SetWindowPreferredRotation(const _Window& window, int rotation)
        }
 
        Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pLayer->GetEcoreEvas());
-       SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x] Set window preferred rotation(%d).", win, rotation);
+
+       if (force == true)
+       {
+               ecore_x_e_window_rotation_app_set(win, EINA_TRUE);
+       }
+       SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] Set window preferred rotation(%d).", win, rotation);
        ecore_evas_wm_rotation_preferred_rotation_set(pLayer->GetEcoreEvas(), rotation);
 
        _Window* pWindow = const_cast<_Window*>(&window);
@@ -2474,7 +2649,7 @@ _EcoreEvas::SetWindowPreferredRotation(const _Window& window, int rotation)
 }
 
 void
-_EcoreEvas::SetWindowAvailabledRotation(const _Window& window, int* rotations, unsigned int count)
+_EcoreEvas::SetWindowAvailabledRotation(const _Window& window, int* rotations, unsigned int count, bool force)
 {
        _EflLayer* pLayer = GetEflLayer(window);
        if (!pLayer)
@@ -2482,23 +2657,30 @@ _EcoreEvas::SetWindowAvailabledRotation(const _Window& window, int* rotations, u
                return;
        }
 
-       // Skip available_set if there is not change
-
-       int* prevRotations = null;
-       unsigned int prevCount = 0;
-       Eina_Bool ret = ecore_evas_wm_rotation_available_rotations_get(pLayer->GetEcoreEvas(), &prevRotations, &prevCount);
-       free(prevRotations);
+       Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pLayer->GetEcoreEvas());
 
-       if (ret)
+       // Skip available_set if there is not change
+       if (force == false)
        {
-               if (prevCount == count)
+               int* prevRotations = null;
+               unsigned int prevCount = 0;
+               Eina_Bool ret = ecore_evas_wm_rotation_available_rotations_get(pLayer->GetEcoreEvas(), &prevRotations, &prevCount);
+               free(prevRotations);
+
+               if (ret)
                {
-                       return;
+                       if (prevCount == count)
+                       {
+                               return;
+                       }
                }
        }
+       else
+       {
+               ecore_x_e_window_rotation_app_set(win, EINA_TRUE);
+       }
 
-       Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pLayer->GetEcoreEvas());
-       SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x] Set window available rotation(%d).", win, count);
+       SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] Set window available rotation(%d).", win, count);
        ecore_evas_wm_rotation_available_rotations_set(pLayer->GetEcoreEvas(), rotations, count);
 }
 
@@ -2526,7 +2708,7 @@ _EcoreEvas::SetWindowRotationBounds(const _Window& window, int rotation, const T
        Rectangle winBounds = _CoordinateSystemUtils::Transform(bounds);
 
        Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pLayer->GetEcoreEvas());
-       SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x] Set rotation bounds(rot = %d, %d, %d, %d, %d).", win, rotation, winBounds.x, winBounds.y, winBounds.width, winBounds.height);
+       SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] Set rotation bounds(ROT %d, %d, %d, %d, %d).", win, rotation, winBounds.x, winBounds.y, winBounds.width, winBounds.height);
        ecore_x_e_window_rotation_geometry_set(win, rotation, winBounds.x, winBounds.y, winBounds.width, winBounds.height);
 }
 
@@ -2543,7 +2725,7 @@ _EcoreEvas::SetWindowRotationBounds(const _Window& window, int rotation, const T
        Rectangle winBounds = _CoordinateSystemUtils::ConvertToInteger(winBoundsF);
 
        Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pLayer->GetEcoreEvas());
-       SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x] Set rotation bounds(rot = %d, %d, %d, %d, %d).", win, rotation, winBounds.x, winBounds.y, winBounds.width, winBounds.height);
+       SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] Set rotation bounds(ROT %d, %d, %d, %d, %d).", win, rotation, winBounds.x, winBounds.y, winBounds.width, winBounds.height);
        ecore_x_e_window_rotation_geometry_set(win, rotation, winBounds.x, winBounds.y, winBounds.width, winBounds.height);
 }
 
@@ -2864,7 +3046,6 @@ _EcoreEvas::InitializeAtomList(void)
        SysTryCatch(NID_UI, __pClipboardClosed, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
 
        __atomRotateRootAngle = ecore_x_atom_get("_E_ILLUME_ROTATE_ROOT_ANGLE");
-       __atomAccessibility = ecore_x_atom_get("_E_MOD_ACC_SCR_READER_");
 
        return r;