int number_of_errors;
} state_t;
-static void load_splash (state_t *state);
+static void show_splash (state_t *state);
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);
-static void show_theme (state_t *state,
- ply_boot_splash_t *splash);
+static ply_boot_splash_t *show_theme (state_t *state,
+ const char *theme_path);
-static void attach_splash_to_seats (state_t *state);
+static void attach_splash_to_seats (state_t *state,
+ ply_boot_splash_t *splash);
static bool attach_to_running_session (state_t *state);
static void detach_from_running_session (state_t *state);
static void on_escape_pressed (state_t *state);
}
static void
-load_detailed_splash (state_t *state)
+show_detailed_splash (state_t *state)
{
ply_boot_splash_t *splash;
return;
ply_trace ("Showing detailed splash screen");
- splash = load_built_in_theme (state);
+ splash = show_theme (state, NULL);
if (splash == NULL)
{
}
static void
-load_default_splash (state_t *state)
+show_default_splash (state_t *state)
{
if (state->boot_splash != NULL)
return;
if (state->override_splash_path != NULL)
{
ply_trace ("Trying override splash at '%s'", state->override_splash_path);
- state->boot_splash = load_theme (state, state->override_splash_path);
+ state->boot_splash = show_theme (state, state->override_splash_path);
}
find_system_default_splash (state);
state->system_default_splash_path != NULL)
{
ply_trace ("Trying system default splash");
- state->boot_splash = load_theme (state, state->system_default_splash_path);
+ state->boot_splash = show_theme (state, state->system_default_splash_path);
}
find_distribution_default_splash (state);
state->distribution_default_splash_path != NULL)
{
ply_trace ("Trying distribution default splash");
- state->boot_splash = load_theme (state, state->distribution_default_splash_path);
+ 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 = load_theme (state, PLYMOUTH_THEME_PATH "default.plymouth");
+ 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 = load_theme (state, PLYMOUTH_THEME_PATH "text/text.plymouth");
+ 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 = load_built_in_theme (state);
+ state->boot_splash = show_theme (state, NULL);
}
if (state->boot_splash == NULL)
if (has_open_seats)
{
ply_trace ("at least one seat already open, so loading splash");
- load_splash (state);
- show_theme (state, state->boot_splash);
+ show_splash (state);
}
else
{
}
static void
-load_splash (state_t *state)
+show_splash (state_t *state)
{
if (state->boot_splash != NULL)
return;
if (plymouth_should_show_default_splash (state))
{
- load_default_splash (state);
+ show_default_splash (state);
state->showing_details = false;
}
else
{
- load_detailed_splash (state);
+ show_detailed_splash (state);
state->showing_details = true;
}
}
{
ply_keyboard_t *keyboard;
- if (state->boot_splash == NULL)
- {
- ply_trace ("seat added before splash loaded, so loading splash now");
- load_splash (state);
- }
-
- if (state->boot_splash != NULL && state->is_shown)
+ if (state->is_shown)
{
- ply_trace ("show-splash already requested, so showing splash now");
- show_theme (state, state->boot_splash);
+ if (state->boot_splash == NULL)
+ {
+ ply_trace ("seat added before splash loaded, so loading splash now");
+ show_splash (state);
+ }
+ else
+ {
+ ply_trace ("seat added after splash loaded, so attaching to splash");
+ ply_boot_splash_attach_to_seat (state->boot_splash, seat);
+ }
}
keyboard = ply_seat_get_keyboard (seat);
if (!state->showing_details)
{
- load_detailed_splash (state);
+ show_detailed_splash (state);
state->showing_details = true;
}
else
{
- load_default_splash (state);
+ show_default_splash (state);
state->showing_details = false;
}
- show_theme (state, state->boot_splash);
}
static void
}
static void
-attach_splash_to_seats (state_t *state)
+attach_splash_to_seats (state_t *state,
+ ply_boot_splash_t *splash)
{
ply_list_t *seats;
seat = ply_list_node_get_data (node);
next_node = ply_list_get_next_node (seats, node);
- ply_boot_splash_attach_to_seat (state->boot_splash, seat);
+ ply_boot_splash_attach_to_seat (splash, seat);
node = next_node;
}
return splash;
}
-static void
+static ply_boot_splash_t *
show_theme (state_t *state,
- ply_boot_splash_t *splash)
+ const char *theme_path)
{
ply_boot_splash_mode_t splash_mode;
+ ply_boot_splash_t *splash;
+
+ if (theme_path != NULL)
+ splash = load_theme (state, theme_path);
+ else
+ splash = load_built_in_theme (state);
- attach_splash_to_seats (state);
+ if (splash == NULL)
+ return NULL;
+
+ attach_splash_to_seats (state, splash);
ply_device_manager_activate_renderers (state->device_manager);
- ply_trace ("showing plugin");
if (state->mode == PLY_MODE_SHUTDOWN)
splash_mode = PLY_BOOT_SPLASH_MODE_SHUTDOWN;
else
ply_save_errno ();
ply_boot_splash_free (splash);
ply_restore_errno ();
- return;
+ return NULL;
}
#ifdef PLY_ENABLE_SYSTEMD_INTEGRATION
ply_device_manager_activate_keyboards (state->device_manager);
show_messages (state);
update_display (state);
+
+ return splash;
}
static bool