]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[main] give quit command precedence over deactivate
authorScott James Remnant <scott@ubuntu.com>
Thu, 18 Mar 2010 20:22:53 +0000 (20:22 +0000)
committerRay Strode <rstrode@redhat.com>
Mon, 22 Mar 2010 02:14:38 +0000 (22:14 -0400)
In the cases where the boot splash plugin does not become idle
immediately, we go back into the main loop and can receive additional
commands.

Since quit and deactive both use this facility, one scenario is the
quit command arriving after the deactivate command, but before the
deactivate command has actually been run.

In that situation, we want to quit, not deactivate.

src/main.c

index a865a1d8197822914d6d012f785b3287297fd44c..bc896a0d9fc4a8f95da8cfe887a6045218d45aa6 100644 (file)
@@ -712,10 +712,26 @@ quit_program (state_t *state)
 static void
 on_boot_splash_idle (state_t *state)
 {
-
   ply_trace ("boot splash idle");
 
-  if (state->deactivate_trigger != NULL)
+  /* In the case where we've received both a deactivate command and a
+   * quit command, the quit command takes precedence.
+   */
+  if (state->quit_trigger != NULL)
+    {
+      if (!state->should_retain_splash)
+        {
+          ply_trace ("hiding splash");
+          if (state->boot_splash != NULL)
+            ply_boot_splash_hide (state->boot_splash);
+        }
+
+      ply_trace ("quitting splash");
+      quit_splash (state);
+      ply_trace ("quitting program");
+      quit_program (state);
+    }
+  else if (state->deactivate_trigger != NULL)
     {
       if (state->renderer != NULL)
         {
@@ -729,21 +745,7 @@ on_boot_splash_idle (state_t *state)
       ply_trigger_pull (state->deactivate_trigger, NULL);
       state->deactivate_trigger = NULL;
       state->is_inactive = true;
-
-      return;
     }
-
-  if (!state->should_retain_splash)
-    {
-      ply_trace ("hiding splash");
-      if (state->boot_splash != NULL)
-          ply_boot_splash_hide (state->boot_splash);
-    }
-
-  ply_trace ("quitting splash");
-  quit_splash (state);
-  ply_trace ("quitting program");
-  quit_program (state);
 }