walters / rpms / plymouth

Forked from rpms/plymouth 6 years ago
Clone
767da6c
From 6ccedf7b6ecdc8314ed97355cfe5499fffb13a1e Mon Sep 17 00:00:00 2001
767da6c
From: Ray Strode <rstrode@redhat.com>
767da6c
Date: Thu, 1 Nov 2012 17:04:33 -0400
5d01314
Subject: [PATCH 1/3] main: if deactivate when already deactivated return
767da6c
 immediately
767da6c
767da6c
We were trying to ignore second deactivate requests, but
767da6c
were instead crashing because we're trying to use a nullified
767da6c
trigger.
767da6c
767da6c
This commit makes sure things don't go crashy when a user
767da6c
does "plymouth deactivate" on an already deactivated plymouthd.
767da6c
---
767da6c
 src/main.c | 8 +++++++-
767da6c
 1 file changed, 7 insertions(+), 1 deletion(-)
767da6c
767da6c
diff --git a/src/main.c b/src/main.c
767da6c
index 88e5002..60ca28f 100644
767da6c
--- a/src/main.c
767da6c
+++ b/src/main.c
767da6c
@@ -1135,7 +1135,13 @@ static void
767da6c
 on_deactivate (state_t       *state,
767da6c
                ply_trigger_t *deactivate_trigger)
767da6c
 {
767da6c
-  if ((state->deactivate_trigger != NULL) || state->is_inactive)
767da6c
+  if (state->is_inactive)
767da6c
+    {
767da6c
+      ply_trigger_pull (deactivate_trigger, NULL);
767da6c
+      return;
767da6c
+    }
767da6c
+
767da6c
+  if (state->deactivate_trigger != NULL)
767da6c
     {
767da6c
       ply_trigger_add_handler (state->deactivate_trigger,
767da6c
                                (ply_trigger_handler_t)
767da6c
-- 
767da6c
1.7.12.1
767da6c
767da6c
767da6c
From b3548ebaf76d222f56d6a7b34c5940b930d47609 Mon Sep 17 00:00:00 2001
767da6c
From: Ray Strode <rstrode@redhat.com>
767da6c
Date: Thu, 1 Nov 2012 17:16:07 -0400
5d01314
Subject: [PATCH 2/3] two-step: don't update progress when idle
767da6c
767da6c
We've already reach a state where we aren't drawing anymore, etc,
767da6c
so don't update progress and potentially fire off animations
767da6c
that won't be seen.
767da6c
---
767da6c
 src/plugins/splash/two-step/plugin.c | 3 +++
767da6c
 1 file changed, 3 insertions(+)
767da6c
767da6c
diff --git a/src/plugins/splash/two-step/plugin.c b/src/plugins/splash/two-step/plugin.c
767da6c
index 2998beb..541a108 100644
767da6c
--- a/src/plugins/splash/two-step/plugin.c
767da6c
+++ b/src/plugins/splash/two-step/plugin.c
767da6c
@@ -1067,6 +1067,9 @@ on_boot_progress (ply_boot_splash_plugin_t *plugin,
767da6c
   if (plugin->state != PLY_BOOT_SPLASH_DISPLAY_NORMAL)
767da6c
     return;
767da6c
 
767da6c
+  if (plugin->is_idle)
767da6c
+    return;
767da6c
+
767da6c
   if (percent_done >= SHOW_ANIMATION_PERCENT)
767da6c
     {
767da6c
       if (plugin->stop_trigger == NULL)
767da6c
-- 
767da6c
1.7.12.1
767da6c
5d01314
5d01314
From a6129abfc527ac247685d80fc5c20144be1badca Mon Sep 17 00:00:00 2001
5d01314
From: Ray Strode <rstrode@redhat.com>
5d01314
Date: Fri, 2 Nov 2012 17:26:41 -0400
5d01314
Subject: [PATCH 3/3] main: make plymouth show-splash idempotent
5d01314
5d01314
plymouth show-splash causes hairy things, that should only happen once,
5d01314
like activating renderers to happen.
5d01314
5d01314
This commit makes subsequent show-splash calls be no-ops.
5d01314
---
5d01314
 src/main.c | 13 +++++++++++++
5d01314
 1 file changed, 13 insertions(+)
5d01314
5d01314
diff --git a/src/main.c b/src/main.c
5d01314
index 60ca28f..ff06163 100644
5d01314
--- a/src/main.c
5d01314
+++ b/src/main.c
5d01314
@@ -113,6 +113,7 @@ typedef struct
5d01314
   uint32_t should_be_attached : 1;
5d01314
   uint32_t should_retain_splash : 1;
5d01314
   uint32_t is_inactive : 1;
5d01314
+  uint32_t is_shown : 1;
5d01314
   uint32_t should_force_details : 1;
5d01314
 
5d01314
   char *kernel_console_tty;
5d01314
@@ -871,6 +872,12 @@ on_show_splash (state_t *state)
5d01314
 {
5d01314
   bool has_display;
5d01314
 
5d01314
+  if (state->is_shown)
5d01314
+    {
5d01314
+      ply_trace ("show splash called while already shown");
5d01314
+      return;
5d01314
+    }
5d01314
+
5d01314
   if (state->is_inactive)
5d01314
     {
5d01314
       ply_trace ("show splash called while inactive");
5d01314
@@ -884,6 +891,8 @@ on_show_splash (state_t *state)
5d01314
       return;
5d01314
     }
5d01314
 
5d01314
+  state->is_shown = true;
5d01314
+
5d01314
   check_for_consoles (state, state->default_tty, true);
5d01314
 
5d01314
   has_display = ply_list_get_length (state->pixel_displays) > 0 ||
5d01314
@@ -1012,6 +1021,8 @@ dump_details_and_quit_splash (state_t *state)
5d01314
   if (state->boot_splash != NULL)
5d01314
     ply_boot_splash_hide (state->boot_splash);
5d01314
 
5d01314
+  state->is_shown = false;
5d01314
+
5d01314
   quit_splash (state);
5d01314
 }
5d01314
 
5d01314
@@ -1116,6 +1127,8 @@ on_boot_splash_idle (state_t *state)
5d01314
             ply_renderer_deactivate (state->renderer);
5d01314
           if (state->boot_splash != NULL)
5d01314
             ply_boot_splash_hide (state->boot_splash);
5d01314
+
5d01314
+          state->is_shown = false;
5d01314
         }
5d01314
 
5d01314
       ply_trace ("quitting splash");
5d01314
-- 
5d01314
1.7.12.1
5d01314