From 56eb4d1ecdfdd3fe998187e01d3714286797fb58 Mon Sep 17 00:00:00 2001 From: Jehun Lim Date: Tue, 4 Aug 2015 19:17:11 +0900 Subject: [PATCH] terminate the app when there is no active view Change-Id: Idbca1e46b1ab6031cad0f5cf51c1b2378dbdea8e Signed-off-by: Jehun Lim --- src/view/mplayer.c | 13 +++++++++---- src/view/viewer.c | 10 ++++++++-- 2 files changed, 17 insertions(+), 6 deletions(-) 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) -- 2.7.4