]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[main] Ignore keyboard changes when deactivating
authorRay Strode <rstrode@redhat.com>
Wed, 14 Apr 2010 19:42:54 +0000 (15:42 -0400)
committerRay Strode <rstrode@redhat.com>
Wed, 14 Apr 2010 19:42:54 +0000 (15:42 -0400)
There is a small window after plymouth is told
to quit or deactivate before it actually does.

During this window, if the user happens to hit
escape, bad things could happen.

We really don't want to mess with, e.g., the tty
settings when we're about to exit.

This commit puts plymouth in a sort of "degraded"
mode while it's deactivating.  During this time
frame, user input is ignored.

src/main.c

index c8b8d8bd5415f57f1df1c477f621378f54f45b05..40fff0f52e212a481bac1bc4df5bb45381139579 100644 (file)
@@ -670,7 +670,6 @@ remove_displays_and_keyboard (state_t *state)
   if (state->keyboard != NULL)
     {
       ply_trace ("removing keyboard");
-      ply_keyboard_stop_watching_for_input (state->keyboard);
       ply_keyboard_free (state->keyboard);
       state->keyboard = NULL;
     }
@@ -845,12 +844,6 @@ deactivate_splash (state_t *state)
       ply_renderer_deactivate (state->renderer);
     }
 
-  if (state->keyboard != NULL)
-    {
-      ply_trace ("deactivating keyboard");
-      ply_keyboard_stop_watching_for_input (state->keyboard);
-    }
-
   if ((state->session != NULL) && state->is_attached)
     {
       ply_trace ("deactivating terminal session");
@@ -921,6 +914,13 @@ on_deactivate (state_t       *state,
   state->deactivate_trigger = deactivate_trigger;
 
   ply_trace ("deactivating");
+
+  if (state->keyboard != NULL)
+    {
+      ply_trace ("deactivating keyboard");
+      ply_keyboard_stop_watching_for_input (state->keyboard);
+    }
+
   if (state->boot_splash != NULL)
     {
       ply_boot_splash_become_idle (state->boot_splash,
@@ -991,8 +991,14 @@ on_quit (state_t       *state,
   ply_trace ("time to quit, closing log");
   if (state->session != NULL)
     ply_terminal_session_close_log (state->session);
-  ply_trace ("unloading splash");
 
+  if (state->keyboard != NULL)
+    {
+      ply_trace ("deactivating keyboard");
+      ply_keyboard_stop_watching_for_input (state->keyboard);
+    }
+
+  ply_trace ("unloading splash");
   if (state->is_inactive && !retain_splash)
     {
       /* We've been deactivated and X failed to start