From: Ray Strode Date: Tue, 23 Sep 2008 18:27:39 +0000 (-0400) Subject: Only hide boot splash on quit if told to do so X-Git-Tag: 0.6.0~143 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2028e64e8be3662e57d5e632b9364fb25d6a3bc5;p=thirdparty%2Fplymouth.git Only hide boot splash on quit if told to do so Extend the daemon-client protocol to include a "retain-splash" flag to the quit request. If it's set then we don't hide the boot splash. --- diff --git a/src/client/ply-boot-client.c b/src/client/ply-boot-client.c index cc105455..cb9546bb 100644 --- a/src/client/ply-boot-client.c +++ b/src/client/ply-boot-client.c @@ -595,14 +595,18 @@ ply_boot_client_tell_daemon_to_hide_splash (ply_boot_client_t * void ply_boot_client_tell_daemon_to_quit (ply_boot_client_t *client, + bool retain_splash, ply_boot_client_response_handler_t handler, ply_boot_client_response_handler_t failed_handler, void *user_data) { + char arg[2] = ""; + assert (client != NULL); + arg[0] = (char) (retain_splash != false); ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_QUIT, - NULL, handler, failed_handler, user_data); + arg, handler, failed_handler, user_data); } void diff --git a/src/client/ply-boot-client.h b/src/client/ply-boot-client.h index 09996efa..a4fc432e 100644 --- a/src/client/ply-boot-client.h +++ b/src/client/ply-boot-client.h @@ -86,6 +86,7 @@ void ply_boot_client_tell_daemon_to_hide_splash (ply_boot_client_t ply_boot_client_response_handler_t failed_handler, void *user_data); void ply_boot_client_tell_daemon_to_quit (ply_boot_client_t *client, + bool retain_splash, ply_boot_client_response_handler_t handler, ply_boot_client_response_handler_t failed_handler, void *user_data); diff --git a/src/client/plymouth.c b/src/client/plymouth.c index d8b60c5c..3133d75a 100644 --- a/src/client/plymouth.c +++ b/src/client/plymouth.c @@ -429,6 +429,7 @@ main (int argc, on_failure, &state); else if (should_quit) ply_boot_client_tell_daemon_to_quit (state.client, + false, (ply_boot_client_response_handler_t) on_success, (ply_boot_client_response_handler_t) diff --git a/src/main.c b/src/main.c index e5868edf..0cbf3d32 100644 --- a/src/main.c +++ b/src/main.c @@ -289,7 +289,8 @@ on_hide_splash (state_t *state) } static void -on_quit (state_t *state) +on_quit (state_t *state, + bool retain_splash) { ply_trace ("time to quit, closing boot.log"); if (state->session != NULL) @@ -297,6 +298,8 @@ on_quit (state_t *state) ply_trace ("unloading splash"); if (state->boot_splash != NULL) { + if (!retain_splash) + ply_boot_splash_hide (state->boot_splash); ply_boot_splash_free (state->boot_splash); state->boot_splash = NULL; } diff --git a/src/ply-boot-server.c b/src/ply-boot-server.c index 8a841485..eafdce81 100644 --- a/src/ply-boot-server.c +++ b/src/ply-boot-server.c @@ -303,8 +303,12 @@ ply_boot_connection_on_request (ply_boot_connection_t *connection) } else if (strcmp (command, PLY_BOOT_PROTOCOL_REQUEST_TYPE_QUIT) == 0) { + bool retain_splash; + + retain_splash = (bool) argument[0]; + if (server->quit_handler != NULL) - server->quit_handler (server->user_data, server); + server->quit_handler (server->user_data, retain_splash, server); } else if (strcmp (command, PLY_BOOT_PROTOCOL_REQUEST_TYPE_PASSWORD) == 0) { diff --git a/src/ply-boot-server.h b/src/ply-boot-server.h index acc95dc6..d9cf7224 100644 --- a/src/ply-boot-server.h +++ b/src/ply-boot-server.h @@ -61,6 +61,7 @@ typedef void (* ply_boot_server_error_handler_t) (void *user_data, ply_boot_server_t *server); typedef void (* ply_boot_server_quit_handler_t) (void *user_data, + bool retain_splash, ply_boot_server_t *server); #ifndef PLY_HIDE_FUNCTION_DECLARATIONS