diff --git a/menu/cbs/menu_cbs_cancel.c b/menu/cbs/menu_cbs_cancel.c index 3c502839d8..0696139b08 100644 --- a/menu/cbs/menu_cbs_cancel.c +++ b/menu/cbs/menu_cbs_cancel.c @@ -17,6 +17,7 @@ #include #include "../menu_driver.h" +#include "../menu_navigation.h" #include "../menu_cbs.h" #include "../../msg_hash.h" @@ -26,10 +27,17 @@ cbs->action_cancel_ident = #name; #endif +/* Clicks the back button */ static int action_cancel_pop_default(const char *path, const char *label, unsigned type, size_t idx) { - return menu_entry_go_back(); + size_t new_selection_ptr; + + menu_navigation_ctl(MENU_NAVIGATION_CTL_GET_SELECTION, &new_selection_ptr); + menu_entries_pop_stack(&new_selection_ptr, 0, 1); + menu_navigation_ctl(MENU_NAVIGATION_CTL_SET_SELECTION, &new_selection_ptr); + + return 0; } static int action_cancel_core_content(const char *path, diff --git a/menu/menu_entry.c b/menu/menu_entry.c index de796153f4..bf22607291 100644 --- a/menu/menu_entry.c +++ b/menu/menu_entry.c @@ -33,18 +33,6 @@ * notify_list_loaded on the UI companion. */ -/* Clicks the back button */ -int menu_entry_go_back(void) -{ - size_t new_selection_ptr; - - menu_navigation_ctl(MENU_NAVIGATION_CTL_GET_SELECTION, &new_selection_ptr); - menu_entries_pop_stack(&new_selection_ptr, 0, 1); - menu_navigation_ctl(MENU_NAVIGATION_CTL_SET_SELECTION, &new_selection_ptr); - - return 0; -} - enum menu_entry_type menu_entry_get_type(uint32_t i) { rarch_setting_t *setting = menu_entries_get_setting(i); diff --git a/menu/menu_entry.h b/menu/menu_entry.h index 9b649c37a3..97ec896087 100644 --- a/menu/menu_entry.h +++ b/menu/menu_entry.h @@ -53,8 +53,6 @@ typedef struct menu_entry unsigned spacing; } menu_entry_t; -int menu_entry_go_back(void); - enum menu_entry_type menu_entry_get_type(uint32_t i); void menu_entry_get_path(uint32_t i, char *s, size_t len); diff --git a/menu/menu_input.c b/menu/menu_input.c index 60286767f5..132f43e5c5 100644 --- a/menu/menu_input.c +++ b/menu/menu_input.c @@ -1128,8 +1128,10 @@ static int menu_input_pointer_post_iterate( { if (!pointer_oldback) { + size_t selection; pointer_oldback = true; - menu_entry_go_back(); + menu_navigation_ctl(MENU_NAVIGATION_CTL_GET_SELECTION, &selection); + menu_entry_action(entry, selection, MENU_ACTION_CANCEL); } } diff --git a/ui/drivers/cocoa/cocoatouch_menu.m b/ui/drivers/cocoa/cocoatouch_menu.m index c217912c7b..a993420835 100644 --- a/ui/drivers/cocoa/cocoatouch_menu.m +++ b/ui/drivers/cocoa/cocoatouch_menu.m @@ -761,7 +761,9 @@ didSelectRowAtIndexPath:(NSIndexPath *)indexPath - (void)menuBack { - menu_entry_go_back(); + size_t selection; + menu_navigation_ctl(MENU_NAVIGATION_CTL_GET_SELECTION, &selection); + menu_entry_action(entry, selection, MENU_ACTION_CANCEL); } @end