ff86aa
From e0e098f6b1240979f7da473f8966cd8043bce576 Mon Sep 17 00:00:00 2001
ff86aa
From: Ray Strode <rstrode@redhat.com>
ff86aa
Date: Thu, 6 Mar 2014 10:02:21 -0500
ff86aa
Subject: [PATCH] main: call update_display when splash is shown
ff86aa
ff86aa
we need to call update display any time a splash is shown,
ff86aa
because there may be a pending password request.
ff86aa
ff86aa
The code attempted to do this in show_splash, but did it before
ff86aa
the splash was assigned to running state, so function was a noop.
ff86aa
ff86aa
This commit moves it a little later in code after the splash is
ff86aa
properly assigned.
ff86aa
---
ff86aa
 src/main.c | 4 +++-
ff86aa
 1 file changed, 3 insertions(+), 1 deletion(-)
ff86aa
ff86aa
diff --git a/src/main.c b/src/main.c
ff86aa
index ccb8b63..fb91bf2 100644
ff86aa
--- a/src/main.c
ff86aa
+++ b/src/main.c
ff86aa
@@ -294,60 +294,61 @@ load_settings (state_t     *state,
ff86aa
           ply_trace ("Splash delay is set to %lf", state->splash_delay);
ff86aa
           state->splash_delay = atof (delay_string);
ff86aa
         }
ff86aa
     }
ff86aa
 
ff86aa
   settings_loaded = true;
ff86aa
 out:
ff86aa
   ply_key_file_free (key_file);
ff86aa
 
ff86aa
   return settings_loaded;
ff86aa
 }
ff86aa
 
ff86aa
 static void
ff86aa
 show_detailed_splash (state_t *state)
ff86aa
 {
ff86aa
   ply_boot_splash_t *splash;
ff86aa
 
ff86aa
   if (state->boot_splash != NULL)
ff86aa
     return;
ff86aa
 
ff86aa
   ply_trace ("Showing detailed splash screen");
ff86aa
   splash = show_theme (state, NULL);
ff86aa
 
ff86aa
   if (splash == NULL)
ff86aa
     {
ff86aa
       ply_trace ("Could not start detailed splash screen, this could be a problem.");
ff86aa
       return;
ff86aa
     }
ff86aa
 
ff86aa
   state->boot_splash = splash;
ff86aa
+  update_display (state);
ff86aa
 }
ff86aa
 
ff86aa
 static const char *
ff86aa
 command_line_get_string_after_prefix (const char *command_line,
ff86aa
                                       const char *prefix)
ff86aa
 {
ff86aa
   char *argument;
ff86aa
 
ff86aa
   argument = strstr (command_line, prefix);
ff86aa
 
ff86aa
   if (argument == NULL)
ff86aa
     return NULL;
ff86aa
 
ff86aa
   if (argument == command_line ||
ff86aa
       argument[-1] == ' ')
ff86aa
     return argument + strlen (prefix);
ff86aa
 
ff86aa
   return NULL;
ff86aa
 }
ff86aa
 
ff86aa
 static bool
ff86aa
 command_line_has_argument (const char *command_line,
ff86aa
                            const char *argument)
ff86aa
 {
ff86aa
     const char *string;
ff86aa
 
ff86aa
     string = command_line_get_string_after_prefix (command_line, argument);
ff86aa
 
ff86aa
     if (string == NULL)
ff86aa
       return false;
ff86aa
@@ -450,60 +451,62 @@ show_default_splash (state_t *state)
ff86aa
     {
ff86aa
       ply_trace ("Trying distribution default splash");
ff86aa
       state->boot_splash = show_theme (state, state->distribution_default_splash_path);
ff86aa
     }
ff86aa
 
ff86aa
   if (state->boot_splash == NULL)
ff86aa
     {
ff86aa
       ply_trace ("Trying old scheme for default splash");
ff86aa
       state->boot_splash = show_theme (state, PLYMOUTH_THEME_PATH "default.plymouth");
ff86aa
     }
ff86aa
 
ff86aa
   if (state->boot_splash == NULL)
ff86aa
     {
ff86aa
       ply_trace ("Could not start default splash screen,"
ff86aa
                  "showing text splash screen");
ff86aa
       state->boot_splash = show_theme (state, PLYMOUTH_THEME_PATH "text/text.plymouth");
ff86aa
     }
ff86aa
 
ff86aa
   if (state->boot_splash == NULL)
ff86aa
     {
ff86aa
       ply_trace ("Could not start text splash screen,"
ff86aa
                  "showing built-in splash screen");
ff86aa
       state->boot_splash = show_theme (state, NULL);
ff86aa
     }
ff86aa
 
ff86aa
   if (state->boot_splash == NULL)
ff86aa
     {
ff86aa
       ply_error ("plymouthd: could not start boot splash: %m");
ff86aa
       return;
ff86aa
     }
ff86aa
+
ff86aa
+  update_display (state);
ff86aa
 }
ff86aa
 
ff86aa
 static void
ff86aa
 cancel_pending_delayed_show (state_t *state)
ff86aa
 {
ff86aa
   if (isnan (state->splash_delay))
ff86aa
     return;
ff86aa
 
ff86aa
   ply_event_loop_stop_watching_for_timeout (state->loop,
ff86aa
                                             (ply_event_loop_timeout_handler_t)
ff86aa
                                             show_splash,
ff86aa
                                             state);
ff86aa
   state->splash_delay = NAN;
ff86aa
 }
ff86aa
 
ff86aa
 static void
ff86aa
 on_ask_for_password (state_t      *state,
ff86aa
                      const char   *prompt,
ff86aa
                      ply_trigger_t *answer)
ff86aa
 {
ff86aa
   ply_entry_trigger_t *entry_trigger;
ff86aa
 
ff86aa
   if (state->boot_splash == NULL)
ff86aa
     {
ff86aa
       /* Waiting to be shown, boot splash will
ff86aa
        * arrive shortly so just sit tight
ff86aa
        */
ff86aa
       if (state->is_shown)
ff86aa
         {
ff86aa
           bool has_open_seats;
ff86aa
@@ -1671,61 +1674,60 @@ show_theme (state_t           *state,
ff86aa
     splash = load_theme (state, theme_path);
ff86aa
   else
ff86aa
     splash = load_built_in_theme (state);
ff86aa
 
ff86aa
   if (splash == NULL)
ff86aa
     return NULL;
ff86aa
 
ff86aa
   attach_splash_to_seats (state, splash);
ff86aa
   ply_device_manager_activate_renderers (state->device_manager);
ff86aa
 
ff86aa
   if (state->mode == PLY_MODE_SHUTDOWN)
ff86aa
     splash_mode = PLY_BOOT_SPLASH_MODE_SHUTDOWN;
ff86aa
   else
ff86aa
     splash_mode = PLY_BOOT_SPLASH_MODE_BOOT_UP;
ff86aa
 
ff86aa
   if (!ply_boot_splash_show (splash, splash_mode))
ff86aa
     {
ff86aa
       ply_save_errno ();
ff86aa
       ply_boot_splash_free (splash);
ff86aa
       ply_restore_errno ();
ff86aa
       return NULL;
ff86aa
     }
ff86aa
 
ff86aa
 #ifdef PLY_ENABLE_SYSTEMD_INTEGRATION
ff86aa
   if (state->is_attached)
ff86aa
     tell_systemd_to_print_details (state);
ff86aa
 #endif
ff86aa
 
ff86aa
   ply_device_manager_activate_keyboards (state->device_manager);
ff86aa
   show_messages (state);
ff86aa
-  update_display (state);
ff86aa
 
ff86aa
   return splash;
ff86aa
 }
ff86aa
 
ff86aa
 static bool
ff86aa
 attach_to_running_session (state_t *state)
ff86aa
 {
ff86aa
   ply_terminal_session_t *session;
ff86aa
   ply_terminal_session_flags_t flags;
ff86aa
   bool should_be_redirected;
ff86aa
 
ff86aa
   flags = 0;
ff86aa
 
ff86aa
   should_be_redirected = !state->no_boot_log;
ff86aa
 
ff86aa
   if (should_be_redirected)
ff86aa
     flags |= PLY_TERMINAL_SESSION_FLAGS_REDIRECT_CONSOLE;
ff86aa
 
ff86aa
  if (state->session == NULL)
ff86aa
    {
ff86aa
      ply_trace ("creating new terminal session");
ff86aa
      session = ply_terminal_session_new (NULL);
ff86aa
 
ff86aa
      ply_terminal_session_attach_to_event_loop (session, state->loop);
ff86aa
    }
ff86aa
  else
ff86aa
    {
ff86aa
      session = state->session;
ff86aa
      ply_trace ("session already created");
ff86aa
    }
ff86aa
-- 
ff86aa
1.8.3.1
ff86aa