From 77c2ceeff4e896b994e4b1c81d39f0473e422e9d Mon Sep 17 00:00:00 2001 From: jdgleaver Date: Fri, 17 May 2019 11:40:39 +0100 Subject: [PATCH] (menu_driver) Prevent spurious navigation events when invoking MENU_NAVIGATION_CTL_CLEAR --- menu/menu_driver.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/menu/menu_driver.c b/menu/menu_driver.c index 678f8dec1f..89217b35fd 100644 --- a/menu/menu_driver.c +++ b/menu/menu_driver.c @@ -2573,13 +2573,21 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data) { bool *pending_push = (bool*)data; + /* Always set current selection to first entry */ menu_navigation_set_selection(0); - menu_driver_navigation_set(true); - if (pending_push) + /* menu_driver_navigation_set() will be called + * at the next 'push'. + * If a push is *not* pending, have to do it here + * instead */ + if (!(*pending_push)) + { + menu_driver_navigation_set(true); + if (menu_driver_ctx->navigation_clear) menu_driver_ctx->navigation_clear( menu_userdata, *pending_push); + } } break; case MENU_NAVIGATION_CTL_INCREMENT: