#include "FUiCtrl_ContextMenu.h"
#include "FUiAnim_DisplayContextImpl.h"
#include "FUiAnimDisplayContext.h"
+#include "FUi_TouchManager.h"
using namespace Tizen::Base;
using namespace Tizen::Base::Runtime;
return EINA_FALSE;
}
+int frameX = 0;
+int frameY = 0;
+int frameW = 0;
+int frameH = 0;
+
+Eina_Bool
+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
OnWindowShown(void* pData, int type, void* pEvent)
{
: __pWindowVisibilityChanged(null)
, __pWindowPropertyChanged(null)
, __pWindowShown(null)
+ , __pWindowConfigured(null)
, __pClientMessageReceived(null)
, __pClearClip(null)
, __pNotifyClip(null)
__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.");
ecore_event_handler_del(__pWindowShown);
__pWindowShown = null;
}
+
+ if (__pWindowConfigured)
+ {
+ ecore_event_handler_del(__pWindowConfigured);
+ __pWindowConfigured = null;
+ }
}
_EcoreEvas::~_EcoreEvas(void)
__pWindowShown = null;
}
+ if (__pWindowConfigured)
+ {
+ ecore_event_handler_del(__pWindowConfigured);
+ __pWindowConfigured = null;
+ }
+
if (__pClientMessageReceived)
{
ecore_event_handler_del(__pClientMessageReceived);