From: Woochan Lee Date: Fri, 19 Feb 2016 05:41:02 +0000 (+0900) Subject: viewmgr: Called deactivate method when view count is 1. X-Git-Tag: submit/tizen/20160617.075742~132 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F69%2F59869%2F4;p=platform%2Fcore%2Fuifw%2Fui-viewmgr.git viewmgr: Called deactivate method when view count is 1. Change-Id: I9d05e190b15c17d565624a0c5f92e4a10344fbef --- diff --git a/src/efl/ui_view.h b/src/efl/ui_view.h index b3d87b4..df0fd13 100644 --- a/src/efl/ui_view.h +++ b/src/efl/ui_view.h @@ -29,6 +29,8 @@ class ui_controller; class ui_view: public ui_view_base { + friend class ui_viewmgr; + public: ui_view(ui_controller *controller, const char *name = NULL); virtual ~ui_view(); diff --git a/src/efl/ui_viewmgr.cpp b/src/efl/ui_viewmgr.cpp index 87ed7d7..67ff19d 100644 --- a/src/efl/ui_viewmgr.cpp +++ b/src/efl/ui_viewmgr.cpp @@ -167,6 +167,7 @@ bool ui_viewmgr::activate() } this->set_indicator(view->get_indicator()); + view->active(); evas_object_show(this->win); @@ -180,6 +181,8 @@ bool ui_viewmgr::deactivate() //FIXME: based on the profile, we should app to go behind or terminate. if (true) { + ui_view *view = dynamic_cast(this->get_last_view()); + if (view) view->inactive(); evas_object_lower(this->win); } else @@ -193,10 +196,8 @@ bool ui_viewmgr::deactivate() bool ui_viewmgr::pop_view() { - if (!ui_viewmgr_base::pop_view()) - { - return false; - } + if (this->get_view_count() == 1) this->deactivate(); + else if(!ui_viewmgr_base::pop_view()) return false; ui_view *view = dynamic_cast(this->get_last_view()); diff --git a/src/interface/ui_viewmgr_base.cpp b/src/interface/ui_viewmgr_base.cpp index ac8e29c..afc835d 100644 --- a/src/interface/ui_viewmgr_base.cpp +++ b/src/interface/ui_viewmgr_base.cpp @@ -161,7 +161,9 @@ bool ui_viewmgr_base::pop_view() view->inactive(); view->unload(); view->destroy(); - return true; + delete(view); + + return false; } //last page to be popped.