]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
throgress: pull trigger right away if already idle
authorIan Pilcher <ipilcher@redhat.com>
Mon, 23 Jul 2012 21:54:19 +0000 (17:54 -0400)
committerRay Strode <rstrode@redhat.com>
Mon, 23 Jul 2012 22:05:28 +0000 (18:05 -0400)
commit eed536ba544dee38aee3c697efd2e3980362954a introduced
a fix for hangs in the two-step plugin. This is a comparable
commit for throbgress.

https://bugzilla.redhat.com/show_bug.cgi?id=704658

src/plugins/splash/throbgress/plugin.c

index 73a2a3c2264759553ed176f94c836182528745f0..9e60ec5f6ec18c653416407dd893b804c1996dc1 100644 (file)
@@ -103,11 +103,15 @@ struct _ply_boot_splash_plugin
   uint32_t root_is_mounted : 1;
   uint32_t is_visible : 1;
   uint32_t is_animating : 1;
+  uint32_t is_idle : 1;
 };
 
 ply_boot_splash_plugin_interface_t * ply_boot_splash_plugin_get_interface (void);
 static void detach_from_event_loop (ply_boot_splash_plugin_t *plugin);
 
+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,
           ply_pixel_display_t      *display)
@@ -304,6 +308,8 @@ view_start_animation (view_t *view)
   if (plugin->mode == PLY_BOOT_SPLASH_MODE_SHUTDOWN)
     return;
 
+  plugin->is_idle = false;
+
   width = ply_throbber_get_width (view->throbber);
   height = ply_throbber_get_height (view->throbber);
   ply_throbber_start (view->throbber,
@@ -521,6 +527,9 @@ start_animation (ply_boot_splash_plugin_t *plugin)
     }
 
   plugin->is_animating = true;
+
+  if (plugin->mode == PLY_BOOT_SPLASH_MODE_SHUTDOWN)
+    plugin->is_idle = TRUE;
 }
 
 static void
@@ -804,7 +813,14 @@ static void
 become_idle (ply_boot_splash_plugin_t *plugin,
              ply_trigger_t            *idle_trigger)
 {
+  if (plugin->is_idle)
+    {
+      ply_trigger_pull (idle_trigger, NULL);
+      return;
+    }
+
   stop_animation (plugin, idle_trigger);
+  plugin->is_idle = true;
 }
 
 static void