[main] fix bug with multiple deactivate commands

If plymouth deactivate is called when we're waiting for the boot
splash to become idle, we end up asserting that there's not
already an idle trigger.

Fix it by checking for an existing deactive trigger, and if there
is, ignoring the new deactivate command (except for pulling its
trigger so it doesn't block).
This commit is contained in:
Scott James Remnant 2010-03-18 20:27:06 +00:00 committed by Ray Strode
parent 764e7dd306
commit 434a4b2ae8

View file

@ -758,10 +758,17 @@ static void
on_deactivate (state_t *state,
ply_trigger_t *deactivate_trigger)
{
if (state->deactivate_trigger != NULL)
{
ply_trigger_pull (deactivate_trigger, NULL);
return;
}
state->deactivate_trigger = deactivate_trigger;
ply_trace ("deactivating");
if (state->boot_splash != NULL)
{
state->deactivate_trigger = deactivate_trigger;
ply_boot_splash_become_idle (state->boot_splash,
(ply_boot_splash_on_idle_handler_t)
on_boot_splash_idle,
@ -769,7 +776,8 @@ on_deactivate (state_t *state,
}
else
{
ply_trigger_pull (deactivate_trigger, NULL);
ply_trigger_pull (state->deactivate_trigger, NULL);
state->deactivate_trigger = NULL;
}
}