]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
Only hide boot splash on quit if told to do so
authorRay Strode <rstrode@redhat.com>
Tue, 23 Sep 2008 18:27:39 +0000 (14:27 -0400)
committerRay Strode <rstrode@redhat.com>
Tue, 23 Sep 2008 18:27:39 +0000 (14:27 -0400)
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.

src/client/ply-boot-client.c
src/client/ply-boot-client.h
src/client/plymouth.c
src/main.c
src/ply-boot-server.c
src/ply-boot-server.h

index cc105455a22c8119c1127914634142d7c5a7fe83..cb9546bbba4b96dfbec9dca6bca7f15eefc33faf 100644 (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
index 09996efa3b322ad295bae494c5204a3007e7cf73..a4fc432ea3d36a5eb716c136e779eed7af8a76df 100644 (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);
index d8b60c5c4f3c82bb3b0c3d624a1742b19ec24802..3133d75a43613380f1794eddf000bad8b23aa74a 100644 (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)
index e5868edf5efdac0a0a2b0ce3f79fc24831003b21..0cbf3d3204a01a110dcd6a3e30213549efbaed42 100644 (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;
     }
index 8a8414858c2904df2e2d9091baac07d47445d94a..eafdce816fa914ea9c386bb31eb0cc55a76153b9 100644 (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)
     {
index acc95dc69c3b22d63abedbf6e31ac94ccc1a093d..d9cf7224e3ad129c78eebdcbf1e38769b4e51de1 100644 (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