Fix activating Frame
authorChoi Munseok <ms47.choi@samsung.com>
Tue, 2 Apr 2013 05:31:30 +0000 (14:31 +0900)
committerChoi Munseok <ms47.choi@samsung.com>
Tue, 2 Apr 2013 05:31:30 +0000 (14:31 +0900)
Change-Id: I0f4e14d49d614c20584a71d2eee06bfa67546589
Signed-off-by: Choi Munseok <ms47.choi@samsung.com>
src/app/FApp_UiAppImpl.cpp
src/ui/controls/FUiCtrl_Frame.cpp

index 2f229d8..3ecc11a 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <bundle.h>
 #include <appsvc/appsvc.h>
+#include <unique_ptr.h>
 
 #include <FBaseSysLog.h>
 #include <FBaseColArrayList.h>
@@ -34,6 +35,8 @@
 #include <FUi_WindowImpl.h>
 #include <FUi_EcoreEvasMgr.h>
 #include <FUi_EcoreEvas.h>
+#include <FUi_UiNotificationEvent.h>
+#include <FUi_UiEventManager.h>
 #include <FUiCtrl_FrameImpl.h>
 #include <FSys_PowerManagerImpl.h>
 
@@ -43,6 +46,7 @@
 #include "FApp_UiAppImpl.h"
 #include "FApp_AppArg.h"
 
+using namespace std;
 using namespace Tizen::App;
 using namespace Tizen::Base;
 using namespace Tizen::Base::Collection;
@@ -161,7 +165,25 @@ _UiAppImpl::OnService(service_s* service, bool initial)
                                        {
                                                // N_SE-24616, N_SE-24383 for OnForground() and visibility issue
                                                OnResume();
-                                               pEvas->ActivateWindow(pFrameImpl->GetCore());
+
+                                               //pEvas->ActivateWindow(pFrameImpl->GetCore());
+                                               
+                                               unique_ptr<ArrayList> pEventArgs(new (std::nothrow) ArrayList());
+                                               SysTryReturnVoidResult(NID_APP, pEventArgs, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
+                                               pEventArgs->Construct();
+                                               
+                                               unique_ptr<String> pString(new (std::nothrow) Tizen::Base::String(L"ActivateFrame"));
+                                               SysTryReturnVoidResult(NID_APP, pString, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
+                                               
+                                               pEventArgs->Add(*(pString.get()));
+                                               
+                                               _UiNotificationEvent event(pFrameImpl->GetCore().GetHandle(), pEventArgs.get());
+                                               
+                                               result r = _UiEventManager::GetInstance()->PostEvent(event);
+                                               SysTryReturnVoidResult(NID_APP, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+                                               
+                                               pString.release();
+                                               pEventArgs.release();
                                        }
                                }
                        }
index 9283722..5d6f048 100644 (file)
@@ -49,6 +49,8 @@ using namespace Tizen::Graphics;
 
 namespace Tizen { namespace Ui { namespace Controls {
 
+const String _ACTIVATE_FRAME = L"ActivateFrame";
+
 _Frame::_Frame(void)
        : __pFramePresenter(null)
        , __pFrameEvent(null)
@@ -214,6 +216,19 @@ _Frame::OnNotifiedN(const _Control& source, IList* pArgs)
 
                return true;
        }
+       else if (*pType == _ACTIVATE_FRAME)
+       {
+               _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
+               if (pEcoreEvas)
+               {
+                       pEcoreEvas->ActivateWindow(*this);
+               }
+
+               pArgs->RemoveAll(true);
+               delete pArgs;
+
+               return true;
+       }
 
        return false;
 }