diff --git a/menu/menu.c b/menu/menu.c index 4e962b9d5e..2e9f868ce6 100644 --- a/menu/menu.c +++ b/menu/menu.c @@ -297,8 +297,8 @@ int menu_iterate(retro_input_t input, action = menu->input.joypad; - if (menu_needs_refresh() && !menu->nonblocking_refresh && action != MENU_ACTION_MESSAGE) - action = MENU_ACTION_REFRESH; + if (menu_do_refresh(action) == 0) + return 0; ret = menu_entry_iterate(action); @@ -313,6 +313,18 @@ int menu_iterate(retro_input_t input, return 0; } +int menu_do_refresh(unsigned action) +{ + menu_handle_t *menu = menu_driver_get_ptr(); + if (!menu || menu->nonblocking_refresh) + return -1; + if (!menu_needs_refresh()) + return -1; + if (action == MENU_ACTION_MESSAGE) + return -1; + return menu_entry_iterate(MENU_ACTION_REFRESH); +} + bool menu_needs_refresh(void) { menu_handle_t *menu = menu_driver_get_ptr(); diff --git a/menu/menu.h b/menu/menu.h index 66be2d0119..7cb5dfadfb 100644 --- a/menu/menu.h +++ b/menu/menu.h @@ -188,6 +188,8 @@ bool menu_load_content(void); void menu_update_system_info(menu_handle_t *menu, bool *load_no_content); +int menu_do_refresh(unsigned action); + bool menu_needs_refresh(void); void menu_set_refresh(void);