Skip to content

Commit 5f0afac

Browse files
committed
xmb+menu_setting: Hide History/Images/Music/Video tabs when history is disabled, refresh on toggle
Apply the same fix as ozone (bdcf692) to the XMB driver: gate the History, Images, Music, and Video system tabs in xmb_refresh_system_tabs_list on history_list_enable in addition to the existing menu_content_show_* flags. Without history tracking these tabs are permanent dead ends with no possibility of content. Favorites is unaffected (independent setting). Additionally, fix the live-toggle behaviour. The previous patch wired MENU_ENUM_LABEL_HISTORY_LIST_ENABLE into the MENU_ENVIRON_RESET_HORIZONTAL_LIST dispatch but stale state in g_defaults.{content,image,music,video}_history meant that the gating logic in menu_displaylist.c (which checks both the menu_content_show_* flag and the corresponding playlist pointer) read the wrong values until the next launch. As a result, the materialui Playlists screen did not visibly update when toggling the setting. Split MENU_ENUM_LABEL_HISTORY_LIST_ENABLE into its own case in general_write_handler that fires CMD_EVENT_HISTORY_INIT (which internally deinits first, then early-returns when the new setting value is OFF), keeping g_defaults pointers in sync with the setting. Also set MENU_ST_FLAG_ENTRIES_NEED_REFRESH so the currently-displayed displaylist is rebuilt - this is what makes materialui's Playlists screen update on toggle, since materialui has no horizontal tab bar of its own to refresh.
1 parent bdcf692 commit 5f0afac

2 files changed

Lines changed: 18 additions & 5 deletions

File tree

menu/drivers/xmb.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3179,27 +3179,27 @@ static void xmb_refresh_system_tabs_list(xmb_handle_t *xmb)
31793179
{
31803180
if (settings->bools.menu_content_show_favorites)
31813181
xmb->tabs[++xmb->system_tab_end] = XMB_SYSTEM_TAB_FAVORITES;
3182-
if (settings->bools.menu_content_show_history)
3182+
if (settings->bools.menu_content_show_history && settings->bools.history_list_enable)
31833183
xmb->tabs[++xmb->system_tab_end] = XMB_SYSTEM_TAB_HISTORY;
31843184
}
31853185
else
31863186
{
3187-
if (settings->bools.menu_content_show_history)
3187+
if (settings->bools.menu_content_show_history && settings->bools.history_list_enable)
31883188
xmb->tabs[++xmb->system_tab_end] = XMB_SYSTEM_TAB_HISTORY;
31893189
if (settings->bools.menu_content_show_favorites)
31903190
xmb->tabs[++xmb->system_tab_end] = XMB_SYSTEM_TAB_FAVORITES;
31913191
}
31923192

31933193
#ifdef HAVE_IMAGEVIEWER
3194-
if (settings->bools.menu_content_show_images)
3194+
if (settings->bools.menu_content_show_images && settings->bools.history_list_enable)
31953195
xmb->tabs[++xmb->system_tab_end] = XMB_SYSTEM_TAB_IMAGES;
31963196
#endif
31973197

3198-
if (settings->bools.menu_content_show_music)
3198+
if (settings->bools.menu_content_show_music && settings->bools.history_list_enable)
31993199
xmb->tabs[++xmb->system_tab_end] = XMB_SYSTEM_TAB_MUSIC;
32003200

32013201
#if defined(HAVE_FFMPEG) || defined(HAVE_MPV)
3202-
if (settings->bools.menu_content_show_video)
3202+
if (settings->bools.menu_content_show_video && settings->bools.history_list_enable)
32033203
xmb->tabs[++xmb->system_tab_end] = XMB_SYSTEM_TAB_VIDEO;
32043204
#endif
32053205

menu/menu_setting.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9322,12 +9322,25 @@ static void general_write_handler(rarch_setting_t *setting)
93229322
case MENU_ENUM_LABEL_CONTENT_SHOW_PLAYLIST_TABS:
93239323
case MENU_ENUM_LABEL_CONTENT_SHOW_EXPLORE:
93249324
case MENU_ENUM_LABEL_CONTENT_SHOW_CONTENTLESS_CORES:
9325+
{
9326+
struct menu_state *menu_st = menu_state_get_ptr();
9327+
if (menu_st->driver_ctx->environ_cb)
9328+
menu_st->driver_ctx->environ_cb(MENU_ENVIRON_RESET_HORIZONTAL_LIST,
9329+
NULL, menu_st->userdata);
9330+
}
9331+
break;
93259332
case MENU_ENUM_LABEL_HISTORY_LIST_ENABLE:
93269333
{
93279334
struct menu_state *menu_st = menu_state_get_ptr();
9335+
/* Sync history playlist init state to the new setting value
9336+
* (HISTORY_INIT internally calls HISTORY_DEINIT first, then
9337+
* early-returns if history_list_enable is now OFF). */
9338+
command_event(CMD_EVENT_HISTORY_INIT, NULL);
93289339
if (menu_st->driver_ctx->environ_cb)
93299340
menu_st->driver_ctx->environ_cb(MENU_ENVIRON_RESET_HORIZONTAL_LIST,
93309341
NULL, menu_st->userdata);
9342+
menu_st->flags |= MENU_ST_FLAG_PREVENT_POPULATE
9343+
| MENU_ST_FLAG_ENTRIES_NEED_REFRESH;
93319344
}
93329345
break;
93339346
case MENU_ENUM_LABEL_SUSPEND_SCREENSAVER_ENABLE:

0 commit comments

Comments
 (0)