UiPopup: fix some minor behaviors. 86/91986/1
authorHermet Park <hermet@hermet.pe.kr>
Wed, 12 Oct 2016 12:00:45 +0000 (21:00 +0900)
committerHermet Park <hermet@hermet.pe.kr>
Wed, 12 Oct 2016 12:00:45 +0000 (21:00 +0900)
1. popup shouldn't be activated if the view is not activated.
2. deactivate() returns an error if the popup state is not activated.

Change-Id: Ieb56a5152c96c56ab7fb646b2ab14d4981ace4fd

src/lib/efl/mobile/UiPopup.cpp

index aa0734de44fcac74c771fec92b2169c42ff94a61..5960e403554639e2a26ed4d886fd73438b6f08c3 100644 (file)
@@ -21,6 +21,9 @@ using namespace efl_viewmanager;
 
 static int _updatePopup(UiPopup *popup)
 {
+       if (popup->getView()->getState() != UI_VIEW_STATE_ACTIVATE)
+               return TIZEN_ERROR_NOT_PERMITTED;
+
        Elm_Win *win = popup->getBase();
        if (!win) return TIZEN_ERROR_NOT_PERMITTED;
 
@@ -69,6 +72,9 @@ Elm_Win *UiPopup::getWindow()
 
 int UiPopup::deactivate()
 {
+       if (this->isActivated() == false)
+               return TIZEN_ERROR_NOT_PERMITTED;
+
        Elm_Popup *popup = this->getContent();
        if (!popup) {
                LOGE("Content is not set! = UiPopup(%p)", this);