From: Charlie Brej Date: Sat, 21 Nov 2009 12:45:45 +0000 (+0000) Subject: [fade-throbber] Move some operations from view to plugin start animation X-Git-Tag: 0.8.0~126 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74ac719031eaefbd840fd602cc5c966cac01593e;p=thirdparty%2Fplymouth.git [fade-throbber] Move some operations from view to plugin start animation There were timeouts called once for each view and the first view would cause is_animating to be set which would stop other views from initialising. --- diff --git a/src/plugins/splash/fade-throbber/plugin.c b/src/plugins/splash/fade-throbber/plugin.c index cf9e6a10..d2d9045a 100644 --- a/src/plugins/splash/fade-throbber/plugin.c +++ b/src/plugins/splash/fade-throbber/plugin.c @@ -547,36 +547,16 @@ on_timeout (ply_boot_splash_plugin_t *plugin) static void view_start_animation (view_t *view) { - ply_boot_splash_plugin_t *plugin; unsigned long screen_width, screen_height; assert (view != NULL); - plugin = view->plugin; - - assert (plugin->loop != NULL); - - if (plugin->is_animating) - return; - screen_width = ply_pixel_display_get_width (view->display); screen_height = ply_pixel_display_get_height (view->display); ply_pixel_display_draw_area (view->display, 0, 0, screen_width, screen_height); - plugin->start_time = ply_get_timestamp (); - animate_at_time (plugin, plugin->start_time); - - if (plugin->mode == PLY_BOOT_SPLASH_MODE_SHUTDOWN) - return; - - ply_event_loop_watch_for_timeout (plugin->loop, - 1.0 / FRAMES_PER_SECOND, - (ply_event_loop_timeout_handler_t) - on_timeout, plugin); - - plugin->is_animating = true; } static void @@ -587,6 +567,9 @@ start_animation (ply_boot_splash_plugin_t *plugin) if (plugin->is_animating) return; + plugin->start_time = ply_get_timestamp (); + animate_at_time (plugin, plugin->start_time); + node = ply_list_get_first_node (plugin->views); while (node != NULL) { @@ -602,6 +585,14 @@ start_animation (ply_boot_splash_plugin_t *plugin) } plugin->is_animating = true; + + if (plugin->mode == PLY_BOOT_SPLASH_MODE_SHUTDOWN) + return; + + ply_event_loop_watch_for_timeout (plugin->loop, + 1.0 / FRAMES_PER_SECOND, + (ply_event_loop_timeout_handler_t) + on_timeout, plugin); } static void