]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[main] move guts of on_escaped_press to new function
authorRay Strode <rstrode@redhat.com>
Wed, 24 Mar 2010 03:54:17 +0000 (23:54 -0400)
committerRay Strode <rstrode@redhat.com>
Wed, 24 Mar 2010 03:54:17 +0000 (23:54 -0400)
Before we were calling the handler directly when it
wasn't in response to an escape key press event, which
was a little groaty.

src/main.c

index 2ad123b54d74b6fdd76631494398c23785d53d27..87146882229177e62b8201e532030b2896daff94 100644 (file)
@@ -740,7 +740,7 @@ static void
 dump_details_and_quit_splash (state_t *state)
 {
   state->showing_details = false;
-  on_escape_pressed (state);
+  toggle_between_splash_and_details (state);
 
   if (state->renderer != NULL)
     ply_renderer_deactivate (state->renderer);
@@ -1067,10 +1067,12 @@ update_display (state_t *state)
 }
 
 static void
-on_escape_pressed (state_t *state)
+toggle_between_splash_and_details (state_t *state)
 {
+  ply_trace ("toggling between splash and details");
   if (state->boot_splash != NULL)
     {
+      ply_trace ("hiding and freeing current splash");
       ply_boot_splash_hide (state->boot_splash);
       ply_boot_splash_free (state->boot_splash);
       state->boot_splash = NULL;
@@ -1089,6 +1091,13 @@ on_escape_pressed (state_t *state)
   update_display (state);
 }
 
+static void
+on_escape_pressed (state_t *state)
+{
+  ply_trace ("escape key pressed");
+  toggle_between_splash_and_details (state);
+}
+
 static void
 on_keyboard_input (state_t                  *state,
                    const char               *keyboard_input,