From: Ray Strode Date: Wed, 6 Jun 2012 17:35:18 +0000 (-0400) Subject: two-step: set is_idle=TRUE at shutdown time X-Git-Tag: 0.8.5~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fwip%2Fsystemd-fixes;p=thirdparty%2Fplymouth.git two-step: set is_idle=TRUE at shutdown time 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. --- diff --git a/src/plugins/splash/two-step/plugin.c b/src/plugins/splash/two-step/plugin.c index 60b8e153..3b2a151b 100644 --- a/src/plugins/splash/two-step/plugin.c +++ b/src/plugins/splash/two-step/plugin.c @@ -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