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.
This commit is contained in:
Ray Strode 2008-09-23 14:27:39 -04:00
parent a7bc5f28a7
commit 2028e64e8b
6 changed files with 17 additions and 3 deletions

View file

@ -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

View file

@ -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);

View file

@ -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)

View file

@ -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;
}

View file

@ -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)
{

View file

@ -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