]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
main: ensure tty is closed on deactivate
authorRay Strode <rstrode@redhat.com>
Sat, 25 Aug 2018 16:21:45 +0000 (12:21 -0400)
committerRay Strode <rstrode@redhat.com>
Mon, 27 Aug 2018 19:16:18 +0000 (15:16 -0400)
If plymouth doesn't get explicitly "activated" then when
GDM tries to deactivate it, the deactivation request is
a noop.

One aspect of being active, though is having ownership and
control of the terminal.  This happens immediately, even
before a splash is shown.

The `deactivate` request needs to relinguish such control,
unconditionally, since some display server is about to use
the tty.

This commit fixes that.

src/main.c

index 7e58fffe05fdb7204f1a51470b4e9be911b62ce5..0564e1567462b36492d9a8901fa166d4513a07de 100644 (file)
@@ -1267,13 +1267,8 @@ quit_program (state_t *state)
 }
 
 static void
-deactivate_splash (state_t *state)
+deactivate_console (state_t *state)
 {
-        assert (!state->is_inactive);
-
-        if (state->boot_splash && ply_boot_splash_uses_pixel_displays (state->boot_splash))
-                ply_device_manager_deactivate_renderers (state->device_manager);
-
         detach_from_running_session (state);
 
         if (state->local_console_terminal != NULL) {
@@ -1287,6 +1282,18 @@ deactivate_splash (state_t *state)
         if (command_line_has_argument (state->kernel_command_line, "plymouth.debug"))
                 ply_logger_close_file (ply_logger_get_error_default ());
 
+}
+
+static void
+deactivate_splash (state_t *state)
+{
+        assert (!state->is_inactive);
+
+        if (state->boot_splash && ply_boot_splash_uses_pixel_displays (state->boot_splash))
+                ply_device_manager_deactivate_renderers (state->device_manager);
+
+        deactivate_console (state);
+
         state->is_inactive = true;
 
         ply_trigger_pull (state->deactivate_trigger, NULL);
@@ -1322,6 +1329,7 @@ on_deactivate (state_t       *state,
                ply_trigger_t *deactivate_trigger)
 {
         if (state->is_inactive) {
+                deactivate_console (state);
                 ply_trigger_pull (deactivate_trigger, NULL);
                 return;
         }