]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
two-step: set is_idle=TRUE at shutdown time wip/systemd-fixes
authorRay Strode <rstrode@redhat.com>
Wed, 6 Jun 2012 17:35:18 +0000 (13:35 -0400)
committerRay Strode <rstrode@redhat.com>
Wed, 6 Jun 2012 14:13:00 +0000 (10:13 -0400)
Right now, we do the end animation immediately if in
shutdown mode.  This is because shutdown is fast,
and we don't try to estimate how long it will take.

The code depends on is_idle being true after the end
animation is run, but we neglect to do that in the
shutdown case.

This commit makes shutdown mode just call
"become_idle" right away, and deletes the duplicated
shutdown code path.

src/plugins/splash/two-step/plugin.c

index 60b8e15366d93320bb04f6304ed5fa0bffbb7bad..3b2a151b71ef191a9a612e542b56ea61b93d6993 100644 (file)
@@ -134,7 +134,8 @@ static void stop_animation (ply_boot_splash_plugin_t *plugin,
 static void detach_from_event_loop (ply_boot_splash_plugin_t *plugin);
 static void display_message (ply_boot_splash_plugin_t *plugin,
                              const char               *message);
-
+static void become_idle (ply_boot_splash_plugin_t *plugin,
+                         ply_trigger_t            *idle_trigger);
 
 static view_t *
 view_new (ply_boot_splash_plugin_t *plugin,
@@ -404,25 +405,11 @@ view_start_progress_animation (view_t *view)
       ply_pixel_display_draw_area (view->display, x, y, width, height);
     }
 
+  /* We don't really know how long shutdown will so
+   * don't show the progress animation
+   */
   if (plugin->mode == PLY_BOOT_SPLASH_MODE_SHUTDOWN)
-    {
-      if (view->throbber != NULL)
-        {
-          ply_trigger_t *throbber_trigger;
-          throbber_trigger = ply_trigger_new (NULL);
-          ply_trigger_add_handler (throbber_trigger,
-                                   (ply_trigger_handler_t)
-                                   on_view_throbber_stopped,
-                                   view);
-          ply_throbber_stop (view->throbber, throbber_trigger);
-        }
-      else
-        {
-          view_start_end_animation (view, NULL);
-        }
-
-      return;
-    }
+    return;
 
   if (view->progress_animation != NULL)
     {
@@ -744,6 +731,13 @@ start_progress_animation (ply_boot_splash_plugin_t *plugin)
     }
 
   plugin->is_animating = true;
+
+  /* We don't really know how long shutdown will, take
+   * but it's normally really fast, so just jump to
+   * the end animation
+   */
+  if (plugin->mode == PLY_BOOT_SPLASH_MODE_SHUTDOWN)
+    become_idle (plugin, NULL);
 }
 
 static void