]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
two-step: Fold ply_progress_animation_hide call into view_start_end_animation
authorHans de Goede <hdegoede@redhat.com>
Thu, 26 Sep 2019 08:15:23 +0000 (10:15 +0200)
committerHans de Goede <hdegoede@redhat.com>
Fri, 27 Sep 2019 07:36:51 +0000 (09:36 +0200)
We should always disable (hide) the progress-animation when
starting the end-animation. Instead of having all callers of
view_start_end_animation do this themselves, do it at the beginning
of view_start_end_animation.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
src/plugins/splash/two-step/plugin.c

index 9b71a5dfefb072fc3753467a2cd0347fba26cc6d..89091db01e60a60ab7ad0578aa57ec755f85377c 100644 (file)
@@ -766,13 +766,12 @@ static void
 view_start_end_animation (view_t        *view,
                           ply_trigger_t *trigger)
 {
-        ply_boot_splash_plugin_t *plugin;
-
-        long x, y;
-        long width, height;
+        ply_boot_splash_plugin_t *plugin = view->plugin;
         unsigned long screen_width, screen_height;
+        long x, y, width, height;
 
-        plugin = view->plugin;
+        if (view->progress_animation != NULL)
+                ply_progress_animation_hide (view->progress_animation);
 
         screen_width = ply_pixel_display_get_width (view->display);
         screen_height = ply_pixel_display_get_height (view->display);
@@ -791,9 +790,6 @@ view_start_end_animation (view_t        *view,
 static void
 on_view_throbber_stopped (view_t *view)
 {
-        ply_trace ("hiding progress animation");
-        if (view->progress_animation != NULL)
-                ply_progress_animation_hide (view->progress_animation);
         view_start_end_animation (view, view->end_trigger);
         view->end_trigger = NULL;
 }
@@ -1241,10 +1237,6 @@ start_end_animation (ply_boot_splash_plugin_t *plugin,
                                                  view);
                         ply_throbber_stop (view->throbber, throbber_trigger);
                 } else {
-                        if (view->progress_animation != NULL) {
-                                ply_trace ("hiding progress animation");
-                                ply_progress_animation_hide (view->progress_animation);
-                        }
                         view_start_end_animation (view, trigger);
                 }