]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
boot-splash: set KD_TEXT from main instead of boot_splash object
authorRay Strode <rstrode@redhat.com>
Tue, 3 Dec 2013 03:07:37 +0000 (22:07 -0500)
committerRay Strode <rstrode@redhat.com>
Tue, 3 Dec 2013 18:50:34 +0000 (13:50 -0500)
Now that debugging keybindings are gone, ply-boot-splash is really
just a wrapper around splash plugins.  As such, it doesn't really
make sense to be mucking with terminal objects from it.

This commit moves that mucking to main until I can find a better
destination for it.

src/libply-splash-core/ply-boot-splash.c
src/main.c

index 7b63a111526491accb636c933222949a715b2839..29247c7734f10d612c67961d73d262ea51e21c67 100644 (file)
@@ -102,32 +102,6 @@ ply_boot_splash_new (const char     *theme_path,
   return splash;
 }
 
-static ply_terminal_t *
-find_local_console_terminal (ply_boot_splash_t *splash)
-{
-  ply_list_node_t *node;
-  node = ply_list_get_first_node (splash->text_displays);
-
-  while (node != NULL)
-    {
-      ply_text_display_t *display;
-      ply_terminal_t *terminal;
-      ply_list_node_t *next_node;
-
-      display = ply_list_node_get_data (node);
-      next_node = ply_list_get_next_node (splash->text_displays, node);
-
-      terminal = ply_text_display_get_terminal (display);
-
-      if (terminal != NULL && ply_terminal_is_vt (terminal))
-        return terminal;
-
-      node = next_node;
-    }
-
-  return NULL;
-}
-
 void
 ply_boot_splash_set_keyboard (ply_boot_splash_t *splash,
                               ply_keyboard_t    *keyboard)
@@ -574,16 +548,6 @@ ply_boot_splash_hide (ply_boot_splash_t *splash)
   splash->plugin_interface->hide_splash_screen (splash->plugin,
                                                 splash->loop);
 
-  if (ply_list_get_length (splash->pixel_displays) >= 1)
-    {
-      ply_terminal_t *terminal;
-
-      terminal = find_local_console_terminal (splash);
-
-      if (terminal != NULL)
-        ply_terminal_set_mode (terminal, PLY_TERMINAL_MODE_TEXT);
-    }
-
   splash->mode = PLY_BOOT_SPLASH_MODE_INVALID;
 
   if (splash->loop != NULL)
index 715e5bdcec68a72606cf7b732b2c8f09f1688fd3..ab5438b13fdc8431b00f888c46ad6223910569f3 100644 (file)
@@ -1004,6 +1004,18 @@ quit_splash (state_t *state)
   detach_from_running_session (state);
 }
 
+static void
+hide_splash (state_t *state)
+{
+  if (state->boot_splash == NULL)
+    return;
+
+  ply_boot_splash_hide (state->boot_splash);
+
+  if (state->local_console_terminal != NULL)
+    ply_terminal_set_mode (state->local_console_terminal, PLY_TERMINAL_MODE_TEXT);
+}
+
 static void
 dump_details_and_quit_splash (state_t *state)
 {
@@ -1012,8 +1024,8 @@ dump_details_and_quit_splash (state_t *state)
 
   if (state->renderer != NULL)
     ply_renderer_deactivate (state->renderer);
-  if (state->boot_splash != NULL)
-    ply_boot_splash_hide (state->boot_splash);
+
+  hide_splash (state);
 
   state->is_shown = false;
 
@@ -1126,8 +1138,8 @@ on_boot_splash_idle (state_t *state)
           ply_trace ("hiding splash");
           if (state->renderer != NULL)
             ply_renderer_deactivate (state->renderer);
-          if (state->boot_splash != NULL)
-            ply_boot_splash_hide (state->boot_splash);
+
+          hide_splash (state);
 
           state->is_shown = false;
         }
@@ -1372,7 +1384,7 @@ toggle_between_splash_and_details (state_t *state)
   if (state->boot_splash != NULL)
     {
       ply_trace ("hiding and freeing current splash");
-      ply_boot_splash_hide (state->boot_splash);
+      hide_splash (state);
       ply_boot_splash_free (state->boot_splash);
       state->boot_splash = NULL;
     }