]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
main: load built-in theme instead of details plugin
authorRay Strode <rstrode@redhat.com>
Thu, 5 Dec 2013 19:51:13 +0000 (14:51 -0500)
committerRay Strode <rstrode@redhat.com>
Fri, 6 Dec 2013 21:23:49 +0000 (16:23 -0500)
We already have the details theme "built" in, so there's
little point in loading the details.so plugin when we want
details internally.

This commit fixes that.

src/main.c

index b6fd805e544c8b1d623830f5e5658f179866f53d..db5d293b76c4fd64683da28764fca86c40dfb7b2 100644 (file)
@@ -125,6 +125,7 @@ typedef struct
   int number_of_errors;
 } state_t;
 
+static ply_boot_splash_t *load_built_in_theme (state_t *state);
 static ply_boot_splash_t *load_theme (state_t    *state,
                                       const char *theme_path,
                                       bool        fall_back_if_neccessary);
@@ -311,18 +312,24 @@ show_messages (state_t *state)
 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");
-  state->boot_splash = start_boot_splash (state,
-                                          PLYMOUTH_THEME_PATH "details/details.plymouth",
-                                          true);
+  splash = load_built_in_theme (state);
 
-  if (state->boot_splash == NULL)
+  if (splash == NULL)
     {
       ply_trace ("Could not start detailed splash screen, this could be a problem.");
+      return;
     }
+
+  state->boot_splash = splash;
+
+  add_displays_and_keyboard_to_boot_splash (state, state->boot_splash);
+  show_theme (state, state->boot_splash);
 }
 
 static const char *
@@ -1668,6 +1675,37 @@ tell_systemd_to_stop_printing_details (state_t *state)
 }
 #endif
 
+static ply_boot_splash_t *
+load_built_in_theme (state_t *state)
+{
+  ply_boot_splash_t *splash;
+  bool is_loaded;
+
+  ply_trace ("Loading built-in theme");
+
+  splash = ply_boot_splash_new ("",
+                                PLYMOUTH_PLUGIN_PATH,
+                                state->boot_buffer);
+
+  is_loaded = ply_boot_splash_load_built_in (splash);
+
+  if (!is_loaded)
+    {
+      ply_save_errno ();
+      ply_boot_splash_free (splash);
+      ply_restore_errno ();
+      return NULL;
+    }
+
+  ply_trace ("attaching plugin to event loop");
+  ply_boot_splash_attach_to_event_loop (splash, state->loop);
+
+  ply_trace ("attaching progress to plugin");
+  ply_boot_splash_attach_progress (splash, state->progress);
+
+  return splash;
+}
+
 static ply_boot_splash_t *
 load_theme (state_t    *state,
             const char *theme_path,