From: Scott James Remnant Date: Thu, 18 Mar 2010 20:22:53 +0000 (+0000) Subject: [main] give quit command precedence over deactivate X-Git-Tag: 0.8.0~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1bd05bccd532da57ece7b1ce30f89a294ff5b14;p=thirdparty%2Fplymouth.git [main] give quit command precedence over deactivate 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. --- diff --git a/src/main.c b/src/main.c index a865a1d8..bc896a0d 100644 --- a/src/main.c +++ b/src/main.c @@ -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); }