summaryrefslogtreecommitdiff
path: root/apps/onplay.c
diff options
context:
space:
mode:
authorChristian Soffke <christian.soffke@gmail.com>2022-11-27 01:15:14 +0100
committerChristian Soffke <christian.soffke@gmail.com>2022-12-11 11:50:33 +0100
commitdfd9c10589d25a966c7e2e4dedab57c59a1987fd (patch)
treef65fcbefd97eff19ec3605aa1dfc161ad4221da6 /apps/onplay.c
parent90d1ac044857781c4885da8cbfde62ece344fce3 (diff)
downloadrockbox-dfd9c10589d25a966c7e2e4dedab57c59a1987fd.tar.gz
rockbox-dfd9c10589d25a966c7e2e4dedab57c59a1987fd.zip
Eliminate skin updates in between activities
1) Adds way to pop activity without refreshing the skin at the same time. Activities are sometimes popped in immediate succession, or one activity is popped before another one is pushed right away. This can lead to the UI appearing glitchy, due to an activity only appearing for a split-second, which is especially noticeable with complex skins that change the dimensions of the UI viewport depending on the current activity To fix this, prevent superfluous skin updates * when switching between: - WPS and browser - WPS and Playlist Catalogue - WPS and playlist - WPS and Settings/System/Plugins * when accessing Track Info or when displaying bookmarks using the context menu on the WPS * when switching from QuickScreen to Shortcuts Menu 2) The playlist viewer activity was pushed & popped redundantly by playlist_view. ---- NB: Behavior has remained unchanged in all instances of the code where pop_current_activity() has been replaced by pop_current_activity(ACTIVITY_REFRESH_NOW). Change-Id: I56b517b8c9dba823a9fed3a3f558d7469dcea9fd
Diffstat (limited to 'apps/onplay.c')
-rw-r--r--apps/onplay.c33
1 files changed, 29 insertions, 4 deletions
diff --git a/apps/onplay.c b/apps/onplay.c
index f2dbf8b3bf..7ea6b9035b 100644
--- a/apps/onplay.c
+++ b/apps/onplay.c
@@ -144,6 +144,15 @@ static bool clipboard_clip(struct clipboard *clip, const char *path,
144/* interface function. */ 144/* interface function. */
145/* ----------------------------------------------------------------------- */ 145/* ----------------------------------------------------------------------- */
146 146
147
148static int bookmark_load_menu_wrapper(void)
149{
150 if (get_current_activity() == ACTIVITY_CONTEXTMENU) /* get rid of parent activity */
151 pop_current_activity(ACTIVITY_REFRESH_DEFERRED); /* when called from ctxt menu */
152
153 return bookmark_load_menu();
154}
155
147static int bookmark_menu_callback(int action, 156static int bookmark_menu_callback(int action,
148 const struct menu_item_ex *this_item, 157 const struct menu_item_ex *this_item,
149 struct gui_synclist *this_list); 158 struct gui_synclist *this_list);
@@ -153,7 +162,7 @@ MENUITEM_FUNCTION(bookmark_create_menu_item, 0,
153 bookmark_menu_callback, Icon_Bookmark); 162 bookmark_menu_callback, Icon_Bookmark);
154MENUITEM_FUNCTION(bookmark_load_menu_item, 0, 163MENUITEM_FUNCTION(bookmark_load_menu_item, 0,
155 ID2P(LANG_BOOKMARK_MENU_LIST), 164 ID2P(LANG_BOOKMARK_MENU_LIST),
156 bookmark_load_menu, NULL, 165 bookmark_load_menu_wrapper, NULL,
157 bookmark_menu_callback, Icon_Bookmark); 166 bookmark_menu_callback, Icon_Bookmark);
158MAKE_ONPLAYMENU(bookmark_menu, ID2P(LANG_BOOKMARK_MENU), 167MAKE_ONPLAYMENU(bookmark_menu, ID2P(LANG_BOOKMARK_MENU),
159 bookmark_menu_callback, Icon_Bookmark, 168 bookmark_menu_callback, Icon_Bookmark,
@@ -462,7 +471,18 @@ static bool save_playlist(void)
462 return false; 471 return false;
463} 472}
464 473
465extern struct menu_item_ex view_cur_playlist; /* from playlist_menu.c */ 474static int wps_view_cur_playlist(void)
475{
476 if (get_current_activity() == ACTIVITY_CONTEXTMENU) /* get rid of parent activity */
477 pop_current_activity(ACTIVITY_REFRESH_DEFERRED); /* when called from ctxt menu */
478
479 playlist_viewer_ex(NULL, NULL);
480
481 return 0;
482}
483
484MENUITEM_FUNCTION(wps_view_cur_playlist_item, 0, ID2P(LANG_VIEW_DYNAMIC_PLAYLIST),
485 wps_view_cur_playlist, NULL, NULL, Icon_NOICON);
466MENUITEM_FUNCTION(search_playlist_item, 0, ID2P(LANG_SEARCH_IN_PLAYLIST), 486MENUITEM_FUNCTION(search_playlist_item, 0, ID2P(LANG_SEARCH_IN_PLAYLIST),
467 search_playlist, NULL, NULL, Icon_Playlist); 487 search_playlist, NULL, NULL, Icon_Playlist);
468MENUITEM_FUNCTION(playlist_save_item, 0, ID2P(LANG_SAVE_DYNAMIC_PLAYLIST), 488MENUITEM_FUNCTION(playlist_save_item, 0, ID2P(LANG_SAVE_DYNAMIC_PLAYLIST),
@@ -473,7 +493,7 @@ MENUITEM_FUNCTION(playing_time_item, 0, ID2P(LANG_PLAYING_TIME),
473 playing_time, NULL, NULL, Icon_Playlist); 493 playing_time, NULL, NULL, Icon_Playlist);
474MAKE_ONPLAYMENU( wps_playlist_menu, ID2P(LANG_PLAYLIST), 494MAKE_ONPLAYMENU( wps_playlist_menu, ID2P(LANG_PLAYLIST),
475 NULL, Icon_Playlist, 495 NULL, Icon_Playlist,
476 &view_cur_playlist, &search_playlist_item, 496 &wps_view_cur_playlist_item, &search_playlist_item,
477 &playlist_save_item, &reshuffle_item, &playing_time_item 497 &playlist_save_item, &reshuffle_item, &playing_time_item
478 ); 498 );
479 499
@@ -1499,6 +1519,9 @@ MENUITEM_FUNCTION(view_cue_item, 0, ID2P(LANG_BROWSE_CUESHEET),
1499 1519
1500static int browse_id3_wrapper(void) 1520static int browse_id3_wrapper(void)
1501{ 1521{
1522 if (get_current_activity() == ACTIVITY_CONTEXTMENU) /* get rid of parent activity */
1523 pop_current_activity(ACTIVITY_REFRESH_DEFERRED); /* when called from ctxt menu */
1524
1502 if (browse_id3(audio_current_track(), 1525 if (browse_id3(audio_current_track(),
1503 playlist_get_display_index(), 1526 playlist_get_display_index(),
1504 playlist_amount())) 1527 playlist_amount()))
@@ -1954,7 +1977,9 @@ int onplay(char* file, int attr, int from, bool hotkey)
1954 else 1977 else
1955 menu = &tree_onplay_menu; 1978 menu = &tree_onplay_menu;
1956 menu_selection = do_menu(menu, NULL, NULL, false); 1979 menu_selection = do_menu(menu, NULL, NULL, false);
1957 pop_current_activity(); 1980
1981 if (get_current_activity() == ACTIVITY_CONTEXTMENU) /* Activity may have been */
1982 pop_current_activity(ACTIVITY_REFRESH_NOW); /* popped already by menu item */
1958 1983
1959 switch (menu_selection) 1984 switch (menu_selection)
1960 { 1985 {