From: Ray Strode Date: Mon, 5 Oct 2009 20:51:40 +0000 (-0400) Subject: [main] Properly reinitialize environment on show splash X-Git-Tag: 0.8.0~177 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2af482af166dbb18816b6f9fbee2b8ea6dc1a355;p=thirdparty%2Fplymouth.git [main] Properly reinitialize environment on show splash Before we were tearing down the displays and keyboard on hide splash but not bringing them back on subsequent show splashes. This fixes that. We can probably throw less stuff away on hide splash, but this is a more conservative fix for now. --- diff --git a/src/main.c b/src/main.c index 08ec1ae4..e827da42 100644 --- a/src/main.c +++ b/src/main.c @@ -131,6 +131,8 @@ static void on_error_message (ply_buffer_t *debug_buffer, size_t number_of_bytes); static ply_buffer_t *debug_buffer; static char *debug_buffer_path = NULL; +static void check_for_consoles (state_t *state, + const char *default_tty); static void on_session_output (state_t *state, @@ -560,6 +562,8 @@ on_show_splash (state_t *state) return; } + check_for_consoles (state, state->default_tty); + has_display = ply_list_get_length (state->pixel_displays) > 0 || ply_list_get_length (state->text_displays) > 0; @@ -597,9 +601,6 @@ quit_splash (state_t *state) state->boot_splash = NULL; } - ply_trace ("removing displays and keyboard"); - remove_displays_and_keyboard (state); - if (state->renderer != NULL) { ply_renderer_close (state->renderer); @@ -607,6 +608,9 @@ quit_splash (state_t *state) state->renderer = NULL; } + ply_trace ("removing displays and keyboard"); + remove_displays_and_keyboard (state); + if (state->session != NULL) { ply_trace ("detaching session"); @@ -1265,9 +1269,11 @@ check_for_consoles (state_t *state, ply_trace ("checking if splash screen should be disabled"); - state->console = ply_console_new (); + if (state->console == NULL) + state->console = ply_console_new (); - if (!ply_console_open (state->console)) + if (!ply_console_is_open (state->console) && + !ply_console_open (state->console)) { ply_trace ("could not open /dev/tty0"); ply_console_free (state->console);