From: Ray Strode Date: Tue, 3 Dec 2013 03:07:37 +0000 (-0500) Subject: boot-splash: set KD_TEXT from main instead of boot_splash object X-Git-Tag: 0.9.0~65^2~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b211cb1736d4d15fa11a5be13cf677fe281fda0;p=thirdparty%2Fplymouth.git boot-splash: set KD_TEXT from main instead of boot_splash object Now that debugging keybindings are gone, ply-boot-splash is really just a wrapper around splash plugins. As such, it doesn't really make sense to be mucking with terminal objects from it. This commit moves that mucking to main until I can find a better destination for it. --- diff --git a/src/libply-splash-core/ply-boot-splash.c b/src/libply-splash-core/ply-boot-splash.c index 7b63a111..29247c77 100644 --- a/src/libply-splash-core/ply-boot-splash.c +++ b/src/libply-splash-core/ply-boot-splash.c @@ -102,32 +102,6 @@ ply_boot_splash_new (const char *theme_path, return splash; } -static ply_terminal_t * -find_local_console_terminal (ply_boot_splash_t *splash) -{ - ply_list_node_t *node; - node = ply_list_get_first_node (splash->text_displays); - - while (node != NULL) - { - ply_text_display_t *display; - ply_terminal_t *terminal; - ply_list_node_t *next_node; - - display = ply_list_node_get_data (node); - next_node = ply_list_get_next_node (splash->text_displays, node); - - terminal = ply_text_display_get_terminal (display); - - if (terminal != NULL && ply_terminal_is_vt (terminal)) - return terminal; - - node = next_node; - } - - return NULL; -} - void ply_boot_splash_set_keyboard (ply_boot_splash_t *splash, ply_keyboard_t *keyboard) @@ -574,16 +548,6 @@ ply_boot_splash_hide (ply_boot_splash_t *splash) splash->plugin_interface->hide_splash_screen (splash->plugin, splash->loop); - if (ply_list_get_length (splash->pixel_displays) >= 1) - { - ply_terminal_t *terminal; - - terminal = find_local_console_terminal (splash); - - if (terminal != NULL) - ply_terminal_set_mode (terminal, PLY_TERMINAL_MODE_TEXT); - } - splash->mode = PLY_BOOT_SPLASH_MODE_INVALID; if (splash->loop != NULL) diff --git a/src/main.c b/src/main.c index 715e5bdc..ab5438b1 100644 --- a/src/main.c +++ b/src/main.c @@ -1004,6 +1004,18 @@ quit_splash (state_t *state) detach_from_running_session (state); } +static void +hide_splash (state_t *state) +{ + if (state->boot_splash == NULL) + return; + + ply_boot_splash_hide (state->boot_splash); + + if (state->local_console_terminal != NULL) + ply_terminal_set_mode (state->local_console_terminal, PLY_TERMINAL_MODE_TEXT); +} + static void dump_details_and_quit_splash (state_t *state) { @@ -1012,8 +1024,8 @@ dump_details_and_quit_splash (state_t *state) if (state->renderer != NULL) ply_renderer_deactivate (state->renderer); - if (state->boot_splash != NULL) - ply_boot_splash_hide (state->boot_splash); + + hide_splash (state); state->is_shown = false; @@ -1126,8 +1138,8 @@ on_boot_splash_idle (state_t *state) ply_trace ("hiding splash"); if (state->renderer != NULL) ply_renderer_deactivate (state->renderer); - if (state->boot_splash != NULL) - ply_boot_splash_hide (state->boot_splash); + + hide_splash (state); state->is_shown = false; } @@ -1372,7 +1384,7 @@ toggle_between_splash_and_details (state_t *state) if (state->boot_splash != NULL) { ply_trace ("hiding and freeing current splash"); - ply_boot_splash_hide (state->boot_splash); + hide_splash (state); ply_boot_splash_free (state->boot_splash); state->boot_splash = NULL; }