forked from rpms/plymouth
171 lines
6.2 KiB
Diff
171 lines
6.2 KiB
Diff
|
From aba38f13c1af535efefb09683ced0920600e7dde Mon Sep 17 00:00:00 2001
|
||
|
From: Hans de Goede <hdegoede@redhat.com>
|
||
|
Date: Tue, 18 Feb 2020 22:03:58 +0100
|
||
|
Subject: [PATCH 6/7] two-step: Add UseEndAnimation setting
|
||
|
|
||
|
We try to start the end animation early based on our progress accounting
|
||
|
but this is highly unreliable because e.g.:
|
||
|
-It counts time to enter the diskcrypt passwd as normal boot time, while
|
||
|
this varies wildly from boot to boot
|
||
|
-Boot times for laptops can differ significantly between docked / undocked
|
||
|
state
|
||
|
|
||
|
Between gdm calling /bin/plymouth deactivate and the drm plugin's deactivate
|
||
|
method getting called there can be e.g. 2.1 seconds (from a random boot),
|
||
|
with a theoretical maximum of 3 seconds (2 seconds to finish the throbber +
|
||
|
1 second for the end animation).
|
||
|
|
||
|
On a modern system userland boot should be able to finish in say 5 seconds,
|
||
|
making gdm wait an additional 1 - 3 seconds for deactivation is a huge amount
|
||
|
of extra wait time!
|
||
|
|
||
|
This commit adds a new "UseEndAnimation" option to the two-step plugin,
|
||
|
which defaults to true. Setting this to false makes deactivation immediate.
|
||
|
|
||
|
This works nicely with the spinner (and bgrt) themes since we do not really
|
||
|
do anything special in the end animation there anyways and since we fade-over
|
||
|
into gdm things will still look ok, while shaving a signifcant chunk of our
|
||
|
boot time.
|
||
|
|
||
|
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||
|
---
|
||
|
src/plugins/splash/two-step/plugin.c | 42 +++++++++++++++++++++++++---
|
||
|
themes/bgrt/bgrt.plymouth.in | 3 ++
|
||
|
themes/spinner/spinner.plymouth.in | 9 ++++++
|
||
|
3 files changed, 50 insertions(+), 4 deletions(-)
|
||
|
|
||
|
diff --git a/src/plugins/splash/two-step/plugin.c b/src/plugins/splash/two-step/plugin.c
|
||
|
index 3dfb011..964855c 100644
|
||
|
--- a/src/plugins/splash/two-step/plugin.c
|
||
|
+++ b/src/plugins/splash/two-step/plugin.c
|
||
|
@@ -121,6 +121,7 @@ typedef struct
|
||
|
bool progress_bar_show_percent_complete;
|
||
|
bool use_progress_bar;
|
||
|
bool use_animation;
|
||
|
+ bool use_end_animation;
|
||
|
bool use_firmware_background;
|
||
|
char *title;
|
||
|
char *subtitle;
|
||
|
@@ -262,12 +263,13 @@ view_free (view_t *view)
|
||
|
static void
|
||
|
view_load_end_animation (view_t *view)
|
||
|
{
|
||
|
+ ply_boot_splash_plugin_t *plugin = view->plugin;
|
||
|
const char *animation_prefix;
|
||
|
- ply_boot_splash_plugin_t *plugin;
|
||
|
|
||
|
- ply_trace ("loading animation");
|
||
|
+ if (!plugin->mode_settings[plugin->mode].use_end_animation)
|
||
|
+ return;
|
||
|
|
||
|
- plugin = view->plugin;
|
||
|
+ ply_trace ("loading animation");
|
||
|
|
||
|
switch (plugin->mode) {
|
||
|
case PLY_BOOT_SPLASH_MODE_BOOT_UP:
|
||
|
@@ -315,6 +317,7 @@ view_load_end_animation (view_t *view)
|
||
|
ply_trace ("optional animation didn't load");
|
||
|
ply_animation_free (view->end_animation);
|
||
|
view->end_animation = NULL;
|
||
|
+ plugin->mode_settings[plugin->mode].use_end_animation = false;
|
||
|
}
|
||
|
|
||
|
static bool
|
||
|
@@ -995,6 +998,13 @@ load_mode_settings (ply_boot_splash_plugin_t *plugin,
|
||
|
else
|
||
|
settings->use_animation = !settings->use_progress_bar;
|
||
|
|
||
|
+ /* This defaults to true for compat. with older themes */
|
||
|
+ if (ply_key_file_has_key (key_file, group_name, "UseEndAnimation"))
|
||
|
+ settings->use_end_animation =
|
||
|
+ ply_key_file_get_bool (key_file, group_name, "UseEndAnimation");
|
||
|
+ else
|
||
|
+ settings->use_end_animation = true;
|
||
|
+
|
||
|
/* If any mode uses the firmware background, then we need to load it */
|
||
|
if (settings->use_firmware_background)
|
||
|
plugin->use_firmware_background = true;
|
||
|
@@ -1260,6 +1270,25 @@ start_end_animation (ply_boot_splash_plugin_t *plugin,
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
+ if (!plugin->mode_settings[plugin->mode].use_end_animation) {
|
||
|
+ node = ply_list_get_first_node (plugin->views);
|
||
|
+ while (node != NULL) {
|
||
|
+ view = ply_list_node_get_data (node);
|
||
|
+
|
||
|
+ ply_progress_bar_hide (view->progress_bar);
|
||
|
+
|
||
|
+ if (view->throbber != NULL)
|
||
|
+ ply_throbber_stop (view->throbber, NULL);
|
||
|
+
|
||
|
+ if (view->progress_animation != NULL)
|
||
|
+ ply_progress_animation_hide (view->progress_animation);
|
||
|
+
|
||
|
+ node = ply_list_get_next_node (plugin->views, node);
|
||
|
+ }
|
||
|
+ ply_trigger_pull (trigger, NULL);
|
||
|
+ return;
|
||
|
+ }
|
||
|
+
|
||
|
ply_trace ("starting end animation");
|
||
|
|
||
|
node = ply_list_get_first_node (plugin->views);
|
||
|
@@ -1718,7 +1747,12 @@ on_boot_progress (ply_boot_splash_plugin_t *plugin,
|
||
|
if (plugin->is_idle)
|
||
|
return;
|
||
|
|
||
|
- if (percent_done >= SHOW_ANIMATION_PERCENT) {
|
||
|
+ /*
|
||
|
+ * If we do not have an end animation, we keep showing progress until
|
||
|
+ * become_idle gets called.
|
||
|
+ */
|
||
|
+ if (plugin->mode_settings[plugin->mode].use_end_animation &&
|
||
|
+ percent_done >= SHOW_ANIMATION_PERCENT) {
|
||
|
if (plugin->stop_trigger == NULL) {
|
||
|
ply_trace ("boot progressed to end");
|
||
|
|
||
|
diff --git a/themes/bgrt/bgrt.plymouth.in b/themes/bgrt/bgrt.plymouth.in
|
||
|
index ac07bc9..994a995 100644
|
||
|
--- a/themes/bgrt/bgrt.plymouth.in
|
||
|
+++ b/themes/bgrt/bgrt.plymouth.in
|
||
|
@@ -25,12 +25,15 @@ DialogClearsFirmwareBackground=true
|
||
|
MessageBelowAnimation=true
|
||
|
|
||
|
[boot-up]
|
||
|
+UseEndAnimation=false
|
||
|
UseFirmwareBackground=true
|
||
|
|
||
|
[shutdown]
|
||
|
+UseEndAnimation=false
|
||
|
UseFirmwareBackground=true
|
||
|
|
||
|
[reboot]
|
||
|
+UseEndAnimation=false
|
||
|
UseFirmwareBackground=true
|
||
|
|
||
|
[updates]
|
||
|
diff --git a/themes/spinner/spinner.plymouth.in b/themes/spinner/spinner.plymouth.in
|
||
|
index 5e5078e..88121c5 100644
|
||
|
--- a/themes/spinner/spinner.plymouth.in
|
||
|
+++ b/themes/spinner/spinner.plymouth.in
|
||
|
@@ -23,6 +23,15 @@ ProgressBarBackgroundColor=0x606060
|
||
|
ProgressBarForegroundColor=0xffffff
|
||
|
MessageBelowAnimation=true
|
||
|
|
||
|
+[boot-up]
|
||
|
+UseEndAnimation=false
|
||
|
+
|
||
|
+[shutdown]
|
||
|
+UseEndAnimation=false
|
||
|
+
|
||
|
+[reboot]
|
||
|
+UseEndAnimation=false
|
||
|
+
|
||
|
[updates]
|
||
|
SuppressMessages=true
|
||
|
ProgressBarShowPercentComplete=true
|
||
|
--
|
||
|
2.25.1
|
||
|
|