From 89680fccb15387fba8db25b534d93c8207fc2fd4 Mon Sep 17 00:00:00 2001 From: Choi Munseok Date: Sat, 8 Jun 2013 11:26:05 +0900 Subject: [PATCH] Resolved the AppWidgetLayer crash Change-Id: I7a2afec52d07266dc08860933f3b4d4e21e68347 Signed-off-by: Choi Munseok --- src/ui/animations/FUiAnim_EflLayer.cpp | 27 ++++++++++++++++++++++++--- src/ui/inc/FUiAnim_EflLayer.h | 3 +++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/ui/animations/FUiAnim_EflLayer.cpp b/src/ui/animations/FUiAnim_EflLayer.cpp index 2f1d4b3..840389b 100644 --- a/src/ui/animations/FUiAnim_EflLayer.cpp +++ b/src/ui/animations/FUiAnim_EflLayer.cpp @@ -272,6 +272,7 @@ _EflLayer::_EflLayer(void) , _needAsyncVisibilityChangeRequest(true) , _isMainType(true) , _needRender(true) + , __isWinObject(true) { _countOfLayer++; } @@ -292,6 +293,7 @@ _EflLayer::_EflLayer(bool isMainType) , _needAsyncVisibilityChangeRequest(true) , _isMainType(isMainType) , _needRender(true) + , __isWinObject(true) { _countOfLayer++; } @@ -399,6 +401,8 @@ _EflLayer::OnConstructed(void) result _EflLayer::Initialize(Evas_Object* pWindow) { + const char* pType = null; + _pWindow = pWindow; SysTryCatch(NID_UI, _pWindow, , E_SYSTEM, "[E_SYSTEM] A system error has been occurred."); _pEvas = evas_object_evas_get(_pWindow); @@ -406,6 +410,12 @@ _EflLayer::Initialize(Evas_Object* pWindow) _pEcoreEvas = ecore_evas_ecore_evas_get(_pEvas); SysTryCatch(NID_UI, _pEcoreEvas, , E_SYSTEM, "[E_SYSTEM] A system error has been occurred."); + pType = evas_object_type_get(_pWindow); + if (strcmp("elm_win", pType)) + { + __isWinObject = false; + } + // CHECK ME: Is this needed for GL mode? #ifdef _NEED_DAMAGE_HANDER_ if(_pOnWindowDamagedHandler == null) @@ -488,7 +498,11 @@ _EflLayer::GetBounds(void) const int h = 0; evas_object_geometry_get(_pWindow, null, null, &w, &h); - elm_win_screen_position_get(_pWindow, &x, &y); + + if (__isWinObject == true) + { + elm_win_screen_position_get(_pWindow, &x, &y); + } return FloatRectangle(x, y, w, h); } @@ -560,7 +574,11 @@ _EflLayer::SetOpacity(float opacity) if (_FloatCompare(opacity, 1.0f)) { // ecore_evas_alpha_set(_pEcoreEvas, EINA_FALSE); - elm_win_alpha_set(_pWindow, EINA_FALSE); + if (__isWinObject == true) + { + elm_win_alpha_set(_pWindow, EINA_FALSE); + } + int r,g,b,a; evas_object_color_get(_pWindow, &r, &g, &b, &a); evas_object_color_set(_pWindow, r, g, b, 255); @@ -570,7 +588,10 @@ _EflLayer::SetOpacity(float opacity) { // ecore_evas_alpha_set(_pEcoreEvas, EINA_TRUE); - elm_win_alpha_set(_pWindow, EINA_TRUE); + if (__isWinObject == true) + { + elm_win_alpha_set(_pWindow, EINA_TRUE); + } int r,g,b,a; evas_object_color_get(_pWindow, &r, &g, &b, &a); diff --git a/src/ui/inc/FUiAnim_EflLayer.h b/src/ui/inc/FUiAnim_EflLayer.h index d65a64c..4ff0139 100644 --- a/src/ui/inc/FUiAnim_EflLayer.h +++ b/src/ui/inc/FUiAnim_EflLayer.h @@ -128,6 +128,9 @@ protected: bool _needRender; static int _countOfLayer; + +private: + bool __isWinObject; }; }}} //namespace Tizen { namespace Ui { namespace Animations -- 2.7.4