From 942d228e3a2578505a94dd1b0838bc74c98e17ed Mon Sep 17 00:00:00 2001 From: natinusala Date: Wed, 10 Apr 2019 16:55:34 +0200 Subject: [PATCH] menu widgets: fix screenshot flash tainting the image --- menu/widgets/menu_widgets.c | 16 +++++++++------- menu/widgets/menu_widgets.h | 2 -- tasks/task_screenshot.c | 5 ----- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/menu/widgets/menu_widgets.c b/menu/widgets/menu_widgets.c index 4b83e7bd11..ef76fa5f0b 100644 --- a/menu/widgets/menu_widgets.c +++ b/menu/widgets/menu_widgets.c @@ -1926,13 +1926,7 @@ static void menu_widgets_screenshot_fadeout(void *userdata) menu_animation_push(&entry); } -void menu_widgets_screenshot_taken(const char *shotname, const char *filename) -{ - strlcpy(screenshot_filename, filename, sizeof(screenshot_filename)); - strlcpy(screenshot_shotname, shotname, sizeof(screenshot_shotname)); -} - -void menu_widgets_take_screenshot(void) +static void menu_widgets_play_screenshot_flash(void) { menu_animation_ctx_entry_t entry; @@ -1950,6 +1944,14 @@ void menu_widgets_take_screenshot(void) menu_animation_push(&entry); } +void menu_widgets_screenshot_taken(const char *shotname, const char *filename) +{ + menu_widgets_play_screenshot_flash(); + strlcpy(screenshot_filename, filename, sizeof(screenshot_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, diff --git a/menu/widgets/menu_widgets.h b/menu/widgets/menu_widgets.h index bf370fc9c6..a2dacaa72d 100644 --- a/menu/widgets/menu_widgets.h +++ b/menu/widgets/menu_widgets.h @@ -60,8 +60,6 @@ bool menu_widgets_task_msg_queue_push(retro_task_t *task, unsigned prio, unsigned duration, bool flush); -void menu_widgets_take_screenshot(void); - void menu_widgets_screenshot_taken(const char *shotname, const char *filename); void menu_widgets_start_load_content_animation(const char *content_name, bool remove_extension); diff --git a/tasks/task_screenshot.c b/tasks/task_screenshot.c index e2a229db23..3138326129 100644 --- a/tasks/task_screenshot.c +++ b/tasks/task_screenshot.c @@ -458,11 +458,6 @@ bool take_screenshot(const char *name_base, bool silence, bool has_valid_framebu bool is_perfcnt_enable = false; bool ret = false; -#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS) - if (!silence) - menu_widgets_take_screenshot(); -#endif - runloop_get_status(&is_paused, &is_idle, &is_slowmotion, &is_perfcnt_enable); ret = take_screenshot_choice(name_base, silence, is_paused, is_idle,