Blob Blame History Raw
From e0e098f6b1240979f7da473f8966cd8043bce576 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Thu, 6 Mar 2014 10:02:21 -0500
Subject: [PATCH] main: call update_display when splash is shown

we need to call update display any time a splash is shown,
because there may be a pending password request.

The code attempted to do this in show_splash, but did it before
the splash was assigned to running state, so function was a noop.

This commit moves it a little later in code after the splash is
properly assigned.
---
 src/main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/main.c b/src/main.c
index ccb8b63..fb91bf2 100644
--- a/src/main.c
+++ b/src/main.c
@@ -294,60 +294,61 @@ load_settings (state_t     *state,
           ply_trace ("Splash delay is set to %lf", state->splash_delay);
           state->splash_delay = atof (delay_string);
         }
     }
 
   settings_loaded = true;
 out:
   ply_key_file_free (key_file);
 
   return settings_loaded;
 }
 
 static void
 show_detailed_splash (state_t *state)
 {
   ply_boot_splash_t *splash;
 
   if (state->boot_splash != NULL)
     return;
 
   ply_trace ("Showing detailed splash screen");
   splash = show_theme (state, NULL);
 
   if (splash == NULL)
     {
       ply_trace ("Could not start detailed splash screen, this could be a problem.");
       return;
     }
 
   state->boot_splash = splash;
+  update_display (state);
 }
 
 static const char *
 command_line_get_string_after_prefix (const char *command_line,
                                       const char *prefix)
 {
   char *argument;
 
   argument = strstr (command_line, prefix);
 
   if (argument == NULL)
     return NULL;
 
   if (argument == command_line ||
       argument[-1] == ' ')
     return argument + strlen (prefix);
 
   return NULL;
 }
 
 static bool
 command_line_has_argument (const char *command_line,
                            const char *argument)
 {
     const char *string;
 
     string = command_line_get_string_after_prefix (command_line, argument);
 
     if (string == NULL)
       return false;
@@ -450,60 +451,62 @@ show_default_splash (state_t *state)
     {
       ply_trace ("Trying distribution default splash");
       state->boot_splash = show_theme (state, state->distribution_default_splash_path);
     }
 
   if (state->boot_splash == NULL)
     {
       ply_trace ("Trying old scheme for default splash");
       state->boot_splash = show_theme (state, PLYMOUTH_THEME_PATH "default.plymouth");
     }
 
   if (state->boot_splash == NULL)
     {
       ply_trace ("Could not start default splash screen,"
                  "showing text splash screen");
       state->boot_splash = show_theme (state, PLYMOUTH_THEME_PATH "text/text.plymouth");
     }
 
   if (state->boot_splash == NULL)
     {
       ply_trace ("Could not start text splash screen,"
                  "showing built-in splash screen");
       state->boot_splash = show_theme (state, NULL);
     }
 
   if (state->boot_splash == NULL)
     {
       ply_error ("plymouthd: could not start boot splash: %m");
       return;
     }
+
+  update_display (state);
 }
 
 static void
 cancel_pending_delayed_show (state_t *state)
 {
   if (isnan (state->splash_delay))
     return;
 
   ply_event_loop_stop_watching_for_timeout (state->loop,
                                             (ply_event_loop_timeout_handler_t)
                                             show_splash,
                                             state);
   state->splash_delay = NAN;
 }
 
 static void
 on_ask_for_password (state_t      *state,
                      const char   *prompt,
                      ply_trigger_t *answer)
 {
   ply_entry_trigger_t *entry_trigger;
 
   if (state->boot_splash == NULL)
     {
       /* Waiting to be shown, boot splash will
        * arrive shortly so just sit tight
        */
       if (state->is_shown)
         {
           bool has_open_seats;
@@ -1671,61 +1674,60 @@ show_theme (state_t           *state,
     splash = load_theme (state, theme_path);
   else
     splash = load_built_in_theme (state);
 
   if (splash == NULL)
     return NULL;
 
   attach_splash_to_seats (state, splash);
   ply_device_manager_activate_renderers (state->device_manager);
 
   if (state->mode == PLY_MODE_SHUTDOWN)
     splash_mode = PLY_BOOT_SPLASH_MODE_SHUTDOWN;
   else
     splash_mode = PLY_BOOT_SPLASH_MODE_BOOT_UP;
 
   if (!ply_boot_splash_show (splash, splash_mode))
     {
       ply_save_errno ();
       ply_boot_splash_free (splash);
       ply_restore_errno ();
       return NULL;
     }
 
 #ifdef PLY_ENABLE_SYSTEMD_INTEGRATION
   if (state->is_attached)
     tell_systemd_to_print_details (state);
 #endif
 
   ply_device_manager_activate_keyboards (state->device_manager);
   show_messages (state);
-  update_display (state);
 
   return splash;
 }
 
 static bool
 attach_to_running_session (state_t *state)
 {
   ply_terminal_session_t *session;
   ply_terminal_session_flags_t flags;
   bool should_be_redirected;
 
   flags = 0;
 
   should_be_redirected = !state->no_boot_log;
 
   if (should_be_redirected)
     flags |= PLY_TERMINAL_SESSION_FLAGS_REDIRECT_CONSOLE;
 
  if (state->session == NULL)
    {
      ply_trace ("creating new terminal session");
      session = ply_terminal_session_new (NULL);
 
      ply_terminal_session_attach_to_event_loop (session, state->loop);
    }
  else
    {
      session = state->session;
      ply_trace ("session already created");
    }
-- 
1.8.3.1