diff options
Diffstat (limited to 'src/view/viewer.c')
-rw-r--r-- | src/view/viewer.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/view/viewer.c b/src/view/viewer.c index ff7bc71..51420de 100644 --- a/src/view/viewer.c +++ b/src/view/viewer.c @@ -87,6 +87,8 @@ struct _priv { struct _slideshow slideshow; bool bar_show; + + const char *prev_view; }; struct _btn_info { @@ -752,16 +754,19 @@ static void _pop_view(struct _priv *priv) priv->viewer.cur == VIEWER_VIDEO) _player_stop(priv); - if (viewmgr_active_view_count() > 1) { + if (!priv->prev_view) { + viewmgr_pop_view(); + ui_app_exit(); + return; + } + + if (!strcmp(priv->prev_view, VIEW_BASE)) { vdata.index = priv->playlist.cur; vdata.id = _get_current_media_id(priv); viewmgr_update_view(VIEW_BASE, UPDATE_FOCUS, &vdata); } viewmgr_pop_view(); - - if (viewmgr_active_view_count() == 0) - ui_app_exit(); } static int _player_get_position(void *data) @@ -1280,6 +1285,7 @@ static void _update(void *view_data, int update_type, void *data) priv->playlist.list = vdata->list; priv->playlist.cur = vdata->index; + priv->prev_view = vdata->id; priv->viewer.foc = BTN_LOC_NONE; priv->slideshow.enable = false; break; |