From 7f7c15fc262841e3005e70ebf40c185da6f99cf5 Mon Sep 17 00:00:00 2001 From: nerdopolis Date: Tue, 5 Dec 2023 06:27:21 -0500 Subject: [PATCH] splash plugins: Better handling the redraw of the console viewer when visible, and the splash state changes --- src/plugins/splash/fade-throbber/plugin.c | 117 +++++++++++++++++++--- src/plugins/splash/space-flares/plugin.c | 108 +++++++++++++++++--- src/plugins/splash/two-step/plugin.c | 104 ++++++++++++++++--- 3 files changed, 286 insertions(+), 43 deletions(-) diff --git a/src/plugins/splash/fade-throbber/plugin.c b/src/plugins/splash/fade-throbber/plugin.c index c063bac1..35b1444c 100644 --- a/src/plugins/splash/fade-throbber/plugin.c +++ b/src/plugins/splash/fade-throbber/plugin.c @@ -104,6 +104,7 @@ struct _ply_boot_splash_plugin double start_time; double now; + uint32_t needs_redraw : 1; uint32_t is_animating : 1; uint32_t is_visible : 1; @@ -126,6 +127,32 @@ static void display_console_messages (ply_boot_splash_plugin_t *plugin); static void hide_console_messages (ply_boot_splash_plugin_t *plugin); static void unhide_console_messages (ply_boot_splash_plugin_t *plugin); +static void +view_show_prompt_on_console_viewer (view_t *view, + const char *prompt, + const char *entry_text, + int number_of_bullets) +{ + ply_boot_splash_plugin_t *plugin = view->plugin; + + if (plugin->state == PLY_BOOT_SPLASH_DISPLAY_NORMAL) + ply_console_viewer_print (view->console_viewer, "\n"); + + ply_console_viewer_clear_line (view->console_viewer); + + ply_console_viewer_print (view->console_viewer, prompt); + + ply_console_viewer_print (view->console_viewer, ": "); + if (entry_text) + ply_console_viewer_print (view->console_viewer, "%s", entry_text); + + for (int i = 0; i < number_of_bullets; i++) { + ply_console_viewer_print (view->console_viewer, " "); + } + + ply_console_viewer_print (view->console_viewer, "_"); +} + static void view_show_prompt (view_t *view, const char *prompt) @@ -172,8 +199,21 @@ view_show_prompt (view_t *view, static void view_hide_prompt (view_t *view) { + ply_boot_splash_plugin_t *plugin; + assert (view != NULL); + plugin = view->plugin; + + /* Obscure the password length in the scroll back */ + if (plugin->state == PLY_BOOT_SPLASH_DISPLAY_PASSWORD_ENTRY) + ply_console_viewer_clear_line (view->console_viewer); + + ply_console_viewer_print (view->console_viewer, "\n"); + + if (ply_entry_is_hidden (view->entry)) + return; + ply_entry_hide (view->entry); ply_label_hide (view->label); } @@ -218,6 +258,8 @@ create_plugin (ply_key_file_t *key_file) plugin->state = PLY_BOOT_SPLASH_DISPLAY_NORMAL; plugin->views = ply_list_new (); + plugin->needs_redraw = true; + return plugin; } @@ -366,9 +408,18 @@ view_redraw (view_t *view) static void redraw_views (ply_boot_splash_plugin_t *plugin) +{ + plugin->needs_redraw = true; +} + +static void +process_needed_redraws (ply_boot_splash_plugin_t *plugin) { ply_list_node_t *node; + if (!plugin->needs_redraw) + return; + node = ply_list_get_first_node (plugin->views); while (node != NULL) { ply_list_node_t *next_node; @@ -381,6 +432,8 @@ redraw_views (ply_boot_splash_plugin_t *plugin) node = next_node; } + + plugin->needs_redraw = false; } static void @@ -667,6 +720,7 @@ draw_background (view_t *view, int width, int height) { + ply_boot_splash_plugin_t *plugin; ply_rectangle_t area; area.x = x; @@ -674,9 +728,15 @@ draw_background (view_t *view, area.width = width; area.height = height; - ply_pixel_buffer_fill_with_gradient (pixel_buffer, &area, - PLYMOUTH_BACKGROUND_START_COLOR, - PLYMOUTH_BACKGROUND_END_COLOR); + plugin = view->plugin; + + if (plugin->should_show_console_messages) { + ply_pixel_buffer_fill_with_hex_color (pixel_buffer, &area, 0); + } else { + ply_pixel_buffer_fill_with_gradient (pixel_buffer, &area, + PLYMOUTH_BACKGROUND_START_COLOR, + PLYMOUTH_BACKGROUND_END_COLOR); + } } static void @@ -776,14 +836,16 @@ on_draw (view_t *view, draw_background (view, pixel_buffer, x, y, width, height); - if (plugin->state == PLY_BOOT_SPLASH_DISPLAY_NORMAL) - draw_normal_view (view, pixel_buffer, x, y, width, height); - else - draw_prompt_view (view, pixel_buffer, x, y, width, height); + if (!plugin->should_show_console_messages) { + if (plugin->state == PLY_BOOT_SPLASH_DISPLAY_NORMAL) + draw_normal_view (view, pixel_buffer, x, y, width, height); + else + draw_prompt_view (view, pixel_buffer, x, y, width, height); - ply_label_draw_area (view->message_label, - pixel_buffer, - x, y, width, height); + ply_label_draw_area (view->message_label, + pixel_buffer, + x, y, width, height); + } if (plugin->plugin_console_messages_updating == false && view->console_viewer) { ply_console_viewer_draw_area (view->console_viewer, pixel_buffer, x, y, width, height); @@ -1014,6 +1076,9 @@ show_message (ply_boot_splash_plugin_t *plugin, ply_pixel_display_draw_area (view->display, 10, 10, ply_label_get_width (view->message_label), ply_label_get_height (view->message_label)); + + + ply_console_viewer_print (view->console_viewer, "\n%s\n", message); node = next_node; } } @@ -1052,6 +1117,7 @@ show_password_prompt (ply_boot_splash_plugin_t *plugin, view = ply_list_node_get_data (node); next_node = ply_list_get_next_node (plugin->views, node); + view_show_prompt_on_console_viewer (view, text, NULL, number_of_bullets); view_show_prompt (view, text); ply_entry_set_bullet_count (view->entry, number_of_bullets); @@ -1074,6 +1140,7 @@ show_prompt (ply_boot_splash_plugin_t *plugin, view = ply_list_node_get_data (node); next_node = ply_list_get_next_node (plugin->views, node); + view_show_prompt_on_console_viewer (view, prompt, entry_text, -1); view_show_prompt (view, prompt); ply_entry_set_text (view->entry, entry_text); @@ -1108,13 +1175,15 @@ display_normal (ply_boot_splash_plugin_t *plugin) hide_prompt (plugin); plugin->state = PLY_BOOT_SPLASH_DISPLAY_NORMAL; - if (!plugin->should_show_console_messages) { + if (!plugin->should_show_console_messages) start_animation (plugin); - } else { - unhide_console_messages (plugin); - } redraw_views (plugin); + + if (plugin->should_show_console_messages) + display_console_messages (plugin); + + process_needed_redraws (plugin); unpause_views (plugin); } @@ -1130,6 +1199,11 @@ display_password (ply_boot_splash_plugin_t *plugin, plugin->state = PLY_BOOT_SPLASH_DISPLAY_PASSWORD_ENTRY; show_password_prompt (plugin, prompt, bullets); redraw_views (plugin); + + if (plugin->should_show_console_messages) + display_console_messages (plugin); + + process_needed_redraws (plugin); unpause_views (plugin); } @@ -1145,6 +1219,11 @@ display_question (ply_boot_splash_plugin_t *plugin, plugin->state = PLY_BOOT_SPLASH_DISPLAY_QUESTION_ENTRY; show_prompt (plugin, prompt, entry_text); redraw_views (plugin); + + if (plugin->should_show_console_messages) + display_console_messages (plugin); + + process_needed_redraws (plugin); unpause_views (plugin); } @@ -1191,6 +1270,9 @@ display_console_messages (ply_boot_splash_plugin_t *plugin) pause_views (plugin); + if (plugin->should_show_console_messages) + stop_animation (plugin); + plugin->plugin_console_messages_updating = true; node = ply_list_get_first_node (plugin->views); while (node != NULL) { @@ -1201,6 +1283,7 @@ display_console_messages (ply_boot_splash_plugin_t *plugin) plugin->plugin_console_messages_updating = false; redraw_views (plugin); + process_needed_redraws (plugin); unpause_views (plugin); } @@ -1208,7 +1291,6 @@ static void unhide_console_messages (ply_boot_splash_plugin_t *plugin) { plugin->should_show_console_messages = true; - stop_animation (plugin); display_console_messages (plugin); } @@ -1220,6 +1302,7 @@ hide_console_messages (ply_boot_splash_plugin_t *plugin) plugin->should_show_console_messages = false; + pause_views (plugin); plugin->plugin_console_messages_updating = true; node = ply_list_get_first_node (plugin->views); while (node != NULL) { @@ -1230,6 +1313,10 @@ hide_console_messages (ply_boot_splash_plugin_t *plugin) plugin->plugin_console_messages_updating = false; if (plugin->state == PLY_BOOT_SPLASH_DISPLAY_NORMAL) start_animation (plugin); + + redraw_views (plugin); + process_needed_redraws (plugin); + unpause_views (plugin); } static void diff --git a/src/plugins/splash/space-flares/plugin.c b/src/plugins/splash/space-flares/plugin.c index 3c8181ae..1e984bac 100644 --- a/src/plugins/splash/space-flares/plugin.c +++ b/src/plugins/splash/space-flares/plugin.c @@ -202,6 +202,7 @@ struct _ply_boot_splash_plugin double progress_target; uint32_t root_is_mounted : 1; + uint32_t needs_redraw : 1; uint32_t is_visible : 1; uint32_t is_animating : 1; @@ -344,9 +345,18 @@ view_redraw (view_t *view) static void redraw_views (ply_boot_splash_plugin_t *plugin) +{ + plugin->needs_redraw = true; +} + +static void +process_needed_redraws (ply_boot_splash_plugin_t *plugin) { ply_list_node_t *node; + if (!plugin->needs_redraw) + return; + node = ply_list_get_first_node (plugin->views); while (node != NULL) { ply_list_node_t *next_node; @@ -359,6 +369,8 @@ redraw_views (ply_boot_splash_plugin_t *plugin) node = next_node; } + + plugin->needs_redraw = false; } static void @@ -442,6 +454,32 @@ view_start_animation (view_t *view) screen_width, screen_height); } +static void +view_show_prompt_on_console_viewer (view_t *view, + const char *prompt, + const char *entry_text, + int number_of_bullets) +{ + ply_boot_splash_plugin_t *plugin = view->plugin; + + if (plugin->state == PLY_BOOT_SPLASH_DISPLAY_NORMAL) + ply_console_viewer_print (view->console_viewer, "\n"); + + ply_console_viewer_clear_line (view->console_viewer); + + ply_console_viewer_print (view->console_viewer, prompt); + + ply_console_viewer_print (view->console_viewer, ": "); + if (entry_text) + ply_console_viewer_print (view->console_viewer, "%s", entry_text); + + for (int i = 0; i < number_of_bullets; i++) { + ply_console_viewer_print (view->console_viewer, " "); + } + + ply_console_viewer_print (view->console_viewer, "_"); +} + static void view_show_prompt (view_t *view, const char *prompt) @@ -493,8 +531,18 @@ view_show_prompt (view_t *view, static void view_hide_prompt (view_t *view) { + ply_boot_splash_plugin_t *plugin; + assert (view != NULL); + plugin = view->plugin; + + /* Obscure the password length in the scroll back */ + if (plugin->state == PLY_BOOT_SPLASH_DISPLAY_PASSWORD_ENTRY) + ply_console_viewer_clear_line (view->console_viewer); + + ply_console_viewer_print (view->console_viewer, "\n"); + ply_entry_hide (view->entry); ply_label_hide (view->label); } @@ -594,6 +642,8 @@ create_plugin (ply_key_file_t *key_file) plugin->views = ply_list_new (); + plugin->needs_redraw = true; + return plugin; } @@ -1334,11 +1384,12 @@ on_draw (view_t *view, if (width == 1 && height == 1) single_pixel = true; - if (plugin->state == PLY_BOOT_SPLASH_DISPLAY_QUESTION_ENTRY || - plugin->state == PLY_BOOT_SPLASH_DISPLAY_PASSWORD_ENTRY) { - uint32_t *box_data, *lock_data; + draw_background (view, pixel_buffer, x, y, width, height); - draw_background (view, pixel_buffer, x, y, width, height); + if ((plugin->state == PLY_BOOT_SPLASH_DISPLAY_QUESTION_ENTRY || + plugin->state == PLY_BOOT_SPLASH_DISPLAY_PASSWORD_ENTRY) && + !plugin->should_show_console_messages) { + uint32_t *box_data, *lock_data; box_data = ply_image_get_data (plugin->box_image); ply_pixel_buffer_fill_with_argb32_data (pixel_buffer, @@ -1350,10 +1401,9 @@ on_draw (view_t *view, ply_pixel_buffer_fill_with_argb32_data (pixel_buffer, &view->lock_area, lock_data); - } else { + } else if (!plugin->should_show_console_messages) { ply_list_node_t *node; - draw_background (view, pixel_buffer, x, y, width, height); for (node = ply_list_get_first_node (view->sprites); node; node = ply_list_get_next_node (view->sprites, node)) { sprite_t *sprite = ply_list_node_get_data (node); @@ -1391,9 +1441,11 @@ on_draw (view_t *view, } if (single_pixel) ply_pixel_buffer_fill_with_color (pixel_buffer, &clip_area, pixel_r, pixel_g, pixel_b, 1.0); - ply_label_draw_area (view->message_label, - pixel_buffer, - x, y, width, height); + + if (!plugin->should_show_console_messages) + ply_label_draw_area (view->message_label, + pixel_buffer, + x, y, width, height); if (plugin->plugin_console_messages_updating == false && view->console_viewer) { ply_console_viewer_draw_area (view->console_viewer, pixel_buffer, x, y, width, height); @@ -1424,6 +1476,11 @@ draw_background (view_t *view, image_area.width = ply_image_get_width (view->scaled_background_image); image_area.height = ply_image_get_height (view->scaled_background_image); + if (plugin->should_show_console_messages) { + ply_pixel_buffer_fill_with_hex_color (pixel_buffer, &area, 0); + return; + } + ply_pixel_buffer_fill_with_argb32_data_with_clip (pixel_buffer, &image_area, &area, ply_image_get_data (view->scaled_background_image)); @@ -1792,6 +1849,7 @@ show_password_prompt (ply_boot_splash_plugin_t *plugin, view = ply_list_node_get_data (node); next_node = ply_list_get_next_node (plugin->views, node); + view_show_prompt_on_console_viewer (view, text, NULL, number_of_bullets); view_show_prompt (view, text); ply_entry_set_bullet_count (view->entry, number_of_bullets); @@ -1814,6 +1872,7 @@ show_prompt (ply_boot_splash_plugin_t *plugin, view = ply_list_node_get_data (node); next_node = ply_list_get_next_node (plugin->views, node); + view_show_prompt_on_console_viewer (view, prompt, entry_text, -1); view_show_prompt (view, prompt); ply_entry_set_text (view->entry, entry_text); @@ -1850,6 +1909,7 @@ show_message (ply_boot_splash_plugin_t *plugin, next_node = ply_list_get_next_node (plugin->views, node); ply_label_set_text (view->message_label, message); ply_label_show (view->message_label, view->display, 10, 10); + ply_console_viewer_print (view->console_viewer, "\n%s\n", message); ply_pixel_display_draw_area (view->display, 10, 10, ply_label_get_width (view->message_label), @@ -1866,13 +1926,15 @@ display_normal (ply_boot_splash_plugin_t *plugin) hide_prompt (plugin); plugin->state = PLY_BOOT_SPLASH_DISPLAY_NORMAL; - if (!plugin->should_show_console_messages) { + if (!plugin->should_show_console_messages) start_animation (plugin); - } else { - unhide_console_messages (plugin); - } redraw_views (plugin); + + if (plugin->should_show_console_messages) + display_console_messages (plugin); + + process_needed_redraws (plugin); unpause_views (plugin); } @@ -1888,6 +1950,11 @@ display_password (ply_boot_splash_plugin_t *plugin, plugin->state = PLY_BOOT_SPLASH_DISPLAY_PASSWORD_ENTRY; show_password_prompt (plugin, prompt, bullets); redraw_views (plugin); + + if (plugin->should_show_console_messages) + display_console_messages (plugin); + + process_needed_redraws (plugin); unpause_views (plugin); } @@ -1903,6 +1970,11 @@ display_question (ply_boot_splash_plugin_t *plugin, plugin->state = PLY_BOOT_SPLASH_DISPLAY_QUESTION_ENTRY; show_prompt (plugin, prompt, entry_text); redraw_views (plugin); + + if (plugin->should_show_console_messages) + display_console_messages (plugin); + + process_needed_redraws (plugin); unpause_views (plugin); } @@ -1948,6 +2020,9 @@ display_console_messages (ply_boot_splash_plugin_t *plugin) pause_views (plugin); + if (plugin->should_show_console_messages) + stop_animation (plugin); + plugin->plugin_console_messages_updating = true; node = ply_list_get_first_node (plugin->views); while (node != NULL) { @@ -1958,6 +2033,7 @@ display_console_messages (ply_boot_splash_plugin_t *plugin) plugin->plugin_console_messages_updating = false; redraw_views (plugin); + process_needed_redraws (plugin); unpause_views (plugin); } @@ -1965,7 +2041,6 @@ static void unhide_console_messages (ply_boot_splash_plugin_t *plugin) { plugin->should_show_console_messages = true; - stop_animation (plugin); display_console_messages (plugin); } @@ -1977,6 +2052,7 @@ hide_console_messages (ply_boot_splash_plugin_t *plugin) plugin->should_show_console_messages = false; + pause_views (plugin); plugin->plugin_console_messages_updating = true; node = ply_list_get_first_node (plugin->views); while (node != NULL) { @@ -1987,6 +2063,10 @@ hide_console_messages (ply_boot_splash_plugin_t *plugin) plugin->plugin_console_messages_updating = false; if (plugin->state == PLY_BOOT_SPLASH_DISPLAY_NORMAL) start_animation (plugin); + + redraw_views (plugin); + process_needed_redraws (plugin); + unpause_views (plugin); } static void diff --git a/src/plugins/splash/two-step/plugin.c b/src/plugins/splash/two-step/plugin.c index ed7fc37b..83a1a58e 100644 --- a/src/plugins/splash/two-step/plugin.c +++ b/src/plugins/splash/two-step/plugin.c @@ -187,6 +187,7 @@ struct _ply_boot_splash_plugin ply_trigger_t *stop_trigger; uint32_t root_is_mounted : 1; + uint32_t needs_redraw : 1; uint32_t is_visible : 1; uint32_t is_animating : 1; uint32_t is_idle : 1; @@ -801,16 +802,27 @@ view_redraw (view_t *view) static void redraw_views (ply_boot_splash_plugin_t *plugin) +{ + plugin->needs_redraw = true; +} + +static void +process_needed_redraws (ply_boot_splash_plugin_t *plugin) { ply_list_node_t *node; view_t *view; + if (!plugin->needs_redraw) + return; + node = ply_list_get_first_node (plugin->views); while (node != NULL) { view = ply_list_node_get_data (node); view_redraw (view); node = ply_list_get_next_node (plugin->views, node); } + + plugin->needs_redraw = false; } static void @@ -947,6 +959,32 @@ view_start_progress_animation (view_t *view) } } +static void +view_show_prompt_on_console_viewer (view_t *view, + const char *prompt, + const char *entry_text, + int number_of_bullets) +{ + ply_boot_splash_plugin_t *plugin = view->plugin; + + if (plugin->state == PLY_BOOT_SPLASH_DISPLAY_NORMAL) + ply_console_viewer_print (view->console_viewer, "\n"); + + ply_console_viewer_clear_line (view->console_viewer); + + ply_console_viewer_print (view->console_viewer, prompt); + + ply_console_viewer_print (view->console_viewer, ": "); + if (entry_text) + ply_console_viewer_print (view->console_viewer, "%s", entry_text); + + for (int i = 0; i < number_of_bullets; i++) { + ply_console_viewer_print (view->console_viewer, " "); + } + + ply_console_viewer_print (view->console_viewer, "_"); +} + static void view_show_prompt (view_t *view, const char *prompt, @@ -1050,9 +1088,20 @@ view_show_prompt (view_t *view, static void view_hide_prompt (view_t *view) { + ply_boot_splash_plugin_t *plugin; + assert (view != NULL); + plugin = view->plugin; + + /* Obscure the password length in the scroll back */ + if (plugin->state == PLY_BOOT_SPLASH_DISPLAY_PASSWORD_ENTRY) + ply_console_viewer_clear_line (view->console_viewer); + + ply_console_viewer_print (view->console_viewer, "\n"); + ply_entry_hide (view->entry); + ply_capslock_icon_hide (view->capslock_icon); ply_keymap_icon_hide (view->keymap_icon); ply_label_hide (view->label); @@ -1314,6 +1363,8 @@ create_plugin (ply_key_file_t *key_file) plugin->views = ply_list_new (); + plugin->needs_redraw = true; + return plugin; } @@ -1561,8 +1612,9 @@ draw_background (view_t *view, using_fw_background && plugin->dialog_clears_firmware_background) use_black_background = true; - if (plugin->should_show_console_messages) + if (plugin->should_show_console_messages) { use_black_background = true; + } if (use_black_background) ply_pixel_buffer_fill_with_hex_color (pixel_buffer, &area, 0); @@ -1612,8 +1664,9 @@ on_draw (view_t *view, ply_pixel_buffer_get_size (pixel_buffer, &screen_area); - if (plugin->state == PLY_BOOT_SPLASH_DISPLAY_QUESTION_ENTRY || - plugin->state == PLY_BOOT_SPLASH_DISPLAY_PASSWORD_ENTRY) { + if ((plugin->state == PLY_BOOT_SPLASH_DISPLAY_QUESTION_ENTRY || + plugin->state == PLY_BOOT_SPLASH_DISPLAY_PASSWORD_ENTRY) && + !plugin->should_show_console_messages) { uint32_t *box_data, *lock_data; if (plugin->box_image) { @@ -1640,7 +1693,7 @@ on_draw (view_t *view, ply_pixel_buffer_fill_with_argb32_data (pixel_buffer, &view->lock_area, lock_data); - } else { + } else if (!plugin->should_show_console_messages) { if (plugin->mode_settings[plugin->mode].use_progress_bar) ply_progress_bar_draw_area (view->progress_bar, pixel_buffer, x, y, width, height); @@ -1698,13 +1751,13 @@ on_draw (view_t *view, pixel_buffer, x, y, width, height); } - ply_label_draw_area (view->message_label, - pixel_buffer, - x, y, width, height); + if (!plugin->should_show_console_messages) + ply_label_draw_area (view->message_label, + pixel_buffer, + x, y, width, height); - if (!plugin->plugin_console_messages_updating && view->console_viewer) { + if (!plugin->plugin_console_messages_updating && view->console_viewer) ply_console_viewer_draw_area (view->console_viewer, pixel_buffer, x, y, width, height); - } } static void @@ -2009,6 +2062,7 @@ show_prompt (ply_boot_splash_plugin_t *plugin, node = ply_list_get_first_node (plugin->views); while (node != NULL) { view = ply_list_node_get_data (node); + view_show_prompt_on_console_viewer (view, prompt, entry_text, number_of_bullets); view_show_prompt (view, prompt, entry_text, number_of_bullets); node = ply_list_get_next_node (plugin->views, node); } @@ -2086,6 +2140,8 @@ view_show_message (view_t *view, ply_label_show (view->message_label, view->display, x, y); ply_pixel_display_draw_area (view->display, x, y, width, height); + + ply_console_viewer_print (view->console_viewer, "\n%s\n", message); } static void @@ -2130,13 +2186,15 @@ display_normal (ply_boot_splash_plugin_t *plugin) plugin->state = PLY_BOOT_SPLASH_DISPLAY_NORMAL; - if (!plugin->should_show_console_messages) { + if (!plugin->should_show_console_messages) start_progress_animation (plugin); - } else { - unhide_console_messages (plugin); - } redraw_views (plugin); + + if (plugin->should_show_console_messages) + display_console_messages (plugin); + + process_needed_redraws (plugin); unpause_views (plugin); } @@ -2152,6 +2210,11 @@ display_password (ply_boot_splash_plugin_t *plugin, plugin->state = PLY_BOOT_SPLASH_DISPLAY_PASSWORD_ENTRY; show_prompt (plugin, prompt, NULL, bullets); redraw_views (plugin); + + if (plugin->should_show_console_messages) + display_console_messages (plugin); + + process_needed_redraws (plugin); unpause_views (plugin); } @@ -2167,6 +2230,11 @@ display_question (ply_boot_splash_plugin_t *plugin, plugin->state = PLY_BOOT_SPLASH_DISPLAY_QUESTION_ENTRY; show_prompt (plugin, prompt, entry_text, -1); redraw_views (plugin); + + if (plugin->should_show_console_messages) + display_console_messages (plugin); + + process_needed_redraws (plugin); unpause_views (plugin); } @@ -2212,6 +2280,9 @@ display_console_messages (ply_boot_splash_plugin_t *plugin) pause_views (plugin); + if (plugin->should_show_console_messages) + stop_animation (plugin); + plugin->plugin_console_messages_updating = true; node = ply_list_get_first_node (plugin->views); while (node != NULL) { @@ -2222,6 +2293,7 @@ display_console_messages (ply_boot_splash_plugin_t *plugin) plugin->plugin_console_messages_updating = false; redraw_views (plugin); + process_needed_redraws (plugin); unpause_views (plugin); } @@ -2229,7 +2301,6 @@ static void unhide_console_messages (ply_boot_splash_plugin_t *plugin) { plugin->should_show_console_messages = true; - stop_animation (plugin); display_console_messages (plugin); } @@ -2241,6 +2312,7 @@ hide_console_messages (ply_boot_splash_plugin_t *plugin) plugin->should_show_console_messages = false; + pause_views (plugin); plugin->plugin_console_messages_updating = true; node = ply_list_get_first_node (plugin->views); while (node != NULL) { @@ -2251,6 +2323,10 @@ hide_console_messages (ply_boot_splash_plugin_t *plugin) plugin->plugin_console_messages_updating = false; if (plugin->state == PLY_BOOT_SPLASH_DISPLAY_NORMAL) start_progress_animation (plugin); + + redraw_views (plugin); + process_needed_redraws (plugin); + unpause_views (plugin); } static void -- 2.47.3