From ea42e6c97b13976cd6f29a68503d1c34ab416fba Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 22 Dec 2016 20:40:35 +0100 Subject: [PATCH] Reset filebrowser types after leaving 'Load From Collection' --- menu/cbs/menu_cbs_cancel.c | 16 ++++++++++++++++ menu/menu_entries.c | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/menu/cbs/menu_cbs_cancel.c b/menu/cbs/menu_cbs_cancel.c index f79221e831..35407e75f0 100644 --- a/menu/cbs/menu_cbs_cancel.c +++ b/menu/cbs/menu_cbs_cancel.c @@ -21,6 +21,8 @@ #include "../menu_cbs.h" #include "../../msg_hash.h" +#include "../widgets/menu_filebrowser.h" + #ifndef BIND_ACTION_CANCEL #define BIND_ACTION_CANCEL(cbs, name) \ cbs->action_cancel = name; \ @@ -32,6 +34,20 @@ static int action_cancel_pop_default(const char *path, const char *label, unsigned type, size_t idx) { size_t new_selection_ptr; + const char *menu_label = NULL; + + menu_entries_get_last_stack(NULL, &menu_label, NULL, NULL, NULL); + +#if 0 + RARCH_LOG("menu_label: %s\n", menu_label); +#endif + + if (!string_is_empty(menu_label) && + string_is_equal(menu_label, + msg_hash_to_str(MENU_ENUM_LABEL_CONTENT_COLLECTION_LIST) + ) + ) + filebrowser_clear_type(); menu_navigation_ctl(MENU_NAVIGATION_CTL_GET_SELECTION, &new_selection_ptr); menu_entries_pop_stack(&new_selection_ptr, 0, 1); diff --git a/menu/menu_entries.c b/menu/menu_entries.c index 30d05b6cba..96ae6eb941 100644 --- a/menu/menu_entries.c +++ b/menu/menu_entries.c @@ -465,7 +465,7 @@ void menu_entries_get_last_stack(const char **path, const char **label, menu_entries_get_last(menu_list_get(menu_list, 0), path, label, file_type, entry_idx); cbs = menu_entries_get_last_stack_actiondata(); - if (cbs) + if (cbs && enum_idx) *enum_idx = cbs->enum_idx; }