01552a
From 1628320b093e3605e91f0aa7183b6859920a0a85 Mon Sep 17 00:00:00 2001
01552a
From: Ray Strode <rstrode@redhat.com>
01552a
Date: Thu, 6 Feb 2014 14:42:40 -0500
01552a
Subject: [PATCH 1/2] main: don't nullify local_console_terminal in quit_splash
01552a
01552a
quit_splash gets called on hide-splash so nullify the terminal
01552a
will make it unavailable on later show-splash calls.
01552a
---
01552a
 src/main.c | 1 -
01552a
 1 file changed, 1 deletion(-)
01552a
01552a
diff --git a/src/main.c b/src/main.c
01552a
index 91e0649..1f9f6dd 100644
01552a
--- a/src/main.c
01552a
+++ b/src/main.c
01552a
@@ -1042,61 +1042,60 @@ load_devices (state_t                    *state,
01552a
 {
01552a
   state->device_manager = ply_device_manager_new (state->default_tty, flags);
01552a
   state->local_console_terminal = ply_device_manager_get_default_terminal (state->device_manager);
01552a
 
01552a
   ply_device_manager_watch_seats (state->device_manager,
01552a
                                   (ply_seat_added_handler_t)
01552a
                                   on_seat_added,
01552a
                                   (ply_seat_removed_handler_t)
01552a
                                   on_seat_removed,
01552a
                                   state);
01552a
 }
01552a
 
01552a
 static void
01552a
 quit_splash (state_t *state)
01552a
 {
01552a
   ply_trace ("quiting splash");
01552a
   if (state->boot_splash != NULL)
01552a
     {
01552a
       ply_trace ("freeing splash");
01552a
       ply_boot_splash_free (state->boot_splash);
01552a
       state->boot_splash = NULL;
01552a
     }
01552a
 
01552a
   if (state->local_console_terminal != NULL)
01552a
     {
01552a
       if (!state->should_retain_splash)
01552a
         {
01552a
           ply_trace ("Not retaining splash, so deallocating VT");
01552a
           ply_terminal_deactivate_vt (state->local_console_terminal);
01552a
         }
01552a
-      state->local_console_terminal = NULL;
01552a
     }
01552a
 
01552a
   detach_from_running_session (state);
01552a
 }
01552a
 
01552a
 static void
01552a
 hide_splash (state_t *state)
01552a
 {
01552a
   state->is_shown = false;
01552a
 
01552a
   cancel_pending_delayed_show (state);
01552a
 
01552a
   if (state->boot_splash == NULL)
01552a
     return;
01552a
 
01552a
   ply_boot_splash_hide (state->boot_splash);
01552a
 
01552a
   if (state->local_console_terminal != NULL)
01552a
     ply_terminal_set_mode (state->local_console_terminal, PLY_TERMINAL_MODE_TEXT);
01552a
 }
01552a
 
01552a
 static void
01552a
 dump_details_and_quit_splash (state_t *state)
01552a
 {
01552a
   state->showing_details = false;
01552a
   toggle_between_splash_and_details (state);
01552a
 
01552a
   ply_device_manager_deactivate_renderers (state->device_manager);
01552a
   hide_splash (state);
01552a
   quit_splash (state);
01552a
-- 
01552a
1.8.3.1
01552a
01552a
01552a
From fea0252399bf9d13e88b27b7296f263732f180fc Mon Sep 17 00:00:00 2001
01552a
From: Ray Strode <rstrode@redhat.com>
01552a
Date: Thu, 6 Feb 2014 15:22:54 -0500
01552a
Subject: [PATCH 2/2] main: detach from keyboard on hide-splash
01552a
01552a
Currently plymouth stays in control of the terminal
01552a
after hide-splash.  This is wrong.  Once plymouth is
01552a
hidden, the terminal should be free to use for other
01552a
programs.
01552a
01552a
This commit makes sure we free up the terminal on
01552a
hide splash.
01552a
---
01552a
 src/main.c | 3 +++
01552a
 1 file changed, 3 insertions(+)
01552a
01552a
diff --git a/src/main.c b/src/main.c
01552a
index 1f9f6dd..92a1cfd 100644
01552a
--- a/src/main.c
01552a
+++ b/src/main.c
01552a
@@ -1035,66 +1035,69 @@ on_seat_added (state_t    *state,
01552a
                                   on_enter, state);
01552a
 
01552a
 }
01552a
 
01552a
 static void
01552a
 load_devices (state_t                    *state,
01552a
               ply_device_manager_flags_t  flags)
01552a
 {
01552a
   state->device_manager = ply_device_manager_new (state->default_tty, flags);
01552a
   state->local_console_terminal = ply_device_manager_get_default_terminal (state->device_manager);
01552a
 
01552a
   ply_device_manager_watch_seats (state->device_manager,
01552a
                                   (ply_seat_added_handler_t)
01552a
                                   on_seat_added,
01552a
                                   (ply_seat_removed_handler_t)
01552a
                                   on_seat_removed,
01552a
                                   state);
01552a
 }
01552a
 
01552a
 static void
01552a
 quit_splash (state_t *state)
01552a
 {
01552a
   ply_trace ("quiting splash");
01552a
   if (state->boot_splash != NULL)
01552a
     {
01552a
       ply_trace ("freeing splash");
01552a
       ply_boot_splash_free (state->boot_splash);
01552a
       state->boot_splash = NULL;
01552a
     }
01552a
 
01552a
+  ply_device_manager_deactivate_keyboards (state->device_manager);
01552a
+
01552a
   if (state->local_console_terminal != NULL)
01552a
     {
01552a
       if (!state->should_retain_splash)
01552a
         {
01552a
           ply_trace ("Not retaining splash, so deallocating VT");
01552a
           ply_terminal_deactivate_vt (state->local_console_terminal);
01552a
+          ply_terminal_close (state->local_console_terminal);
01552a
         }
01552a
     }
01552a
 
01552a
   detach_from_running_session (state);
01552a
 }
01552a
 
01552a
 static void
01552a
 hide_splash (state_t *state)
01552a
 {
01552a
   state->is_shown = false;
01552a
 
01552a
   cancel_pending_delayed_show (state);
01552a
 
01552a
   if (state->boot_splash == NULL)
01552a
     return;
01552a
 
01552a
   ply_boot_splash_hide (state->boot_splash);
01552a
 
01552a
   if (state->local_console_terminal != NULL)
01552a
     ply_terminal_set_mode (state->local_console_terminal, PLY_TERMINAL_MODE_TEXT);
01552a
 }
01552a
 
01552a
 static void
01552a
 dump_details_and_quit_splash (state_t *state)
01552a
 {
01552a
   state->showing_details = false;
01552a
   toggle_between_splash_and_details (state);
01552a
 
01552a
   ply_device_manager_deactivate_renderers (state->device_manager);
01552a
   hide_splash (state);
01552a
-- 
01552a
1.8.3.1
01552a