diff --git a/menu/widgets/menu_widgets.c b/menu/widgets/menu_widgets.c index bdb63a24a5..9ce1dcd82d 100644 --- a/menu/widgets/menu_widgets.c +++ b/menu/widgets/menu_widgets.c @@ -329,7 +329,7 @@ static void msg_widget_msg_transition_animation_done(void *userdata) msg->msg_transition_animation = 0.0f; } -static bool menu_widgets_msg_queue_push_internal( +bool menu_widgets_msg_queue_push( retro_task_t *task, const char *msg, unsigned duration, char *title, @@ -339,10 +339,6 @@ static bool menu_widgets_msg_queue_push_internal( { menu_widget_msg_t* msg_widget = NULL; -#ifdef HAVE_THREADS - runloop_msg_queue_lock(); -#endif - ui_companion_driver_msg_queue_push(msg, prio, task ? duration : duration * 60 / 1000, flush); @@ -510,24 +506,9 @@ static bool menu_widgets_msg_queue_push_internal( } } -#ifdef HAVE_THREADS - runloop_msg_queue_unlock(); -#endif - return true; } -bool menu_widgets_msg_queue_push(const char *msg, - unsigned duration, - char *title, - enum message_queue_icon icon, enum message_queue_category category, - unsigned prio, bool flush) -{ - if (menu_widgets_inited) - return menu_widgets_msg_queue_push_internal(NULL, msg, duration, title, icon, category, prio, flush); - return false; -} - static void menu_widgets_unfold_end(void *userdata) { menu_widget_msg_t *unfold = (menu_widget_msg_t*) userdata; @@ -2153,20 +2134,6 @@ void menu_widgets_screenshot_taken(const char *shotname, const char *filename) strlcpy(screenshot_shotname, shotname, sizeof(screenshot_shotname)); } -bool menu_widgets_task_msg_queue_push(retro_task_t *task, - const char *msg, - unsigned prio, unsigned duration, - bool flush) -{ - if (!menu_widgets_inited) - return false; - - if (task->title != NULL && !task->mute) - menu_widgets_msg_queue_push_internal(task, msg, duration, NULL, (enum message_queue_icon)MESSAGE_QUEUE_CATEGORY_INFO, (enum message_queue_category)MESSAGE_QUEUE_ICON_DEFAULT, prio, flush); - - return true; -} - static void menu_widgets_end_load_content_animation(void *userdata) { #if 0 diff --git a/menu/widgets/menu_widgets.h b/menu/widgets/menu_widgets.h index f5a53ff52d..a7e43848e8 100644 --- a/menu/widgets/menu_widgets.h +++ b/menu/widgets/menu_widgets.h @@ -41,10 +41,12 @@ void menu_widgets_init(bool video_is_threaded); void menu_widgets_free(void); bool menu_widgets_ready(void); -bool menu_widgets_msg_queue_push(const char *msg, +bool menu_widgets_msg_queue_push( + retro_task_t *task, const char *msg, unsigned duration, char *title, - enum message_queue_icon icon, enum message_queue_category category, + enum message_queue_icon icon, + enum message_queue_category category, unsigned prio, bool flush); bool menu_widgets_volume_update_and_show(void); diff --git a/retroarch.c b/retroarch.c index b1846d9ece..132b41aef2 100644 --- a/retroarch.c +++ b/retroarch.c @@ -14236,7 +14236,18 @@ void runloop_task_msg_queue_push(retro_task_t *task, const char *msg, bool flush) { #if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS) - if (!menu_widgets_task_msg_queue_push(task, msg, prio, duration, flush)) + bool ready = menu_widgets_ready(); + if (ready && task->title && !task->mute) + { +#ifdef HAVE_THREADS + runloop_msg_queue_lock_internal(); +#endif + menu_widgets_msg_queue_push(task, msg, duration, NULL, (enum message_queue_icon)MESSAGE_QUEUE_CATEGORY_INFO, (enum message_queue_category)MESSAGE_QUEUE_ICON_DEFAULT, prio, flush); +#ifdef HAVE_THREADS + runloop_msg_queue_unlock_internal(); +#endif + } + else #endif runloop_msg_queue_push(msg, prio, duration, flush, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO); } @@ -14248,16 +14259,23 @@ void runloop_msg_queue_push(const char *msg, enum message_queue_icon icon, enum message_queue_category category) { runloop_ctx_msg_info_t msg_info; -#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS) - if (menu_widgets_msg_queue_push(msg, - roundf((float)duration / 60.0f * 1000.0f), title, icon, category, prio, flush)) - return; -#endif #ifdef HAVE_THREADS runloop_msg_queue_lock_internal(); #endif +#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS) + if (menu_widgets_ready()) + { + menu_widgets_msg_queue_push(NULL, msg, + roundf((float)duration / 60.0f * 1000.0f), title, icon, category, prio, flush); +#ifdef HAVE_THREADS + runloop_msg_queue_unlock_internal(); +#endif + return; + } +#endif + if (flush) msg_queue_clear(runloop_msg_queue);