From: Jehun Lim Date: Tue, 4 Aug 2015 10:17:11 +0000 (+0900) Subject: terminate the app when there is no active view X-Git-Tag: accepted/tizen/tv/20150804.235436^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=56eb4d1ecdfdd3fe998187e01d3714286797fb58;p=profile%2Ftv%2Fapps%2Fnative%2Fair_mediahub.git terminate the app when there is no active view Change-Id: Idbca1e46b1ab6031cad0f5cf51c1b2378dbdea8e Signed-off-by: Jehun Lim --- diff --git a/src/view/mplayer.c b/src/view/mplayer.c index 6062725..7c5ac35 100644 --- a/src/view/mplayer.c +++ b/src/view/mplayer.c @@ -14,6 +14,7 @@ * limitations under the License. */ +#include #include #include #include @@ -440,10 +441,15 @@ static void _pop_view(struct _priv *priv) { struct view_update_data vdata; - vdata.index = priv->playlist.cur; + if (viewmgr_active_view_count() > 1) { + vdata.index = priv->playlist.cur; + viewmgr_update_view(VIEW_BASE, UPDATE_FOCUS, &vdata); + } - viewmgr_update_view(VIEW_BASE, UPDATE_FOCUS, &vdata); viewmgr_pop_view(); + + if (viewmgr_active_view_count() == 0) + ui_app_exit(); } static void _key_down(int id, void *data, Evas *e, Evas_Object *obj, @@ -457,9 +463,8 @@ static void _key_down(int id, void *data, Evas *e, Evas_Object *obj, priv = data; if (!strcmp(ev->keyname, KEY_BACK) || - !strcmp(ev->keyname, KEY_BACK_REMOTE)) { + !strcmp(ev->keyname, KEY_BACK_REMOTE)) _pop_view(priv); - } } static void _list_set_focus(struct _priv *priv) diff --git a/src/view/viewer.c b/src/view/viewer.c index 1d658fa..e6fcd53 100644 --- a/src/view/viewer.c +++ b/src/view/viewer.c @@ -14,6 +14,7 @@ * limitations under the License. */ +#include #include #include #include @@ -637,10 +638,15 @@ static void _pop_view(struct _priv *priv) priv->viewer.cur == VIEWER_VIDEO) _player_stop(priv); - vdata.index = priv->playlist.cur; + if (viewmgr_active_view_count() > 1) { + vdata.index = priv->playlist.cur; + viewmgr_update_view(VIEW_BASE, UPDATE_FOCUS, &vdata); + } - viewmgr_update_view(VIEW_BASE, UPDATE_FOCUS, &vdata); viewmgr_pop_view(); + + if (viewmgr_active_view_count() == 0) + ui_app_exit(); } static void _timeout_cb(void *data, int type, void *ei)