alaurie / rpms / plymouth

Forked from rpms/plymouth 4 days ago
Clone

Blame SOURCES/fix-escape-key-for-media-check.patch

01552a
From 014f62a8701e7c69436bfbf37a0f1b73968a23e8 Mon Sep 17 00:00:00 2001
01552a
From: Ray Strode <rstrode@redhat.com>
01552a
Date: Fri, 1 Jul 2016 16:39:59 -0400
01552a
Subject: [PATCH] main: fix escape key for media check
01552a
01552a
Right now, if a show-splash request comes in, then
01552a
we don't actually operate on it until splash delay
01552a
seconds later (~5 by default).
01552a
01552a
The problem is, if a hide-splash request comes in, in the mean
01552a
while, we don't cancel the queued show-splash request.
01552a
01552a
This commit fixes that.
01552a
---
01552a
 src/main.c | 10 +++++++++-
01552a
 1 file changed, 9 insertions(+), 1 deletion(-)
01552a
01552a
diff --git a/src/main.c b/src/main.c
01552a
index 7c4ea3c..8a201f8 100644
01552a
--- a/src/main.c
01552a
+++ b/src/main.c
01552a
@@ -1153,62 +1153,70 @@ hide_splash (state_t *state)
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
 
01552a
 static void
01552a
 on_hide_splash (state_t *state)
01552a
 {
01552a
   if (state->is_inactive)
01552a
     return;
01552a
 
01552a
+  /* If the splash is NULL then we haven't shown it yet,
01552a
+   * but we still need to call hide splash so it won't show
01552a
+   * spontaneously after the splash delay later.
01552a
+   */
01552a
   if (state->boot_splash == NULL)
01552a
-    return;
01552a
+    {
01552a
+      ply_trace ("cancelling pending show splash operation (if any)");
01552a
+      hide_splash (state);
01552a
+      return;
01552a
+    }
01552a
 
01552a
   ply_trace ("hiding boot splash");
01552a
   dump_details_and_quit_splash (state);
01552a
 }
01552a
 
01552a
 #ifdef PLY_ENABLE_DEPRECATED_GDM_TRANSITION
01552a
 static void
01552a
 tell_gdm_to_transition (void)
01552a
 {
01552a
   int fd;
01552a
 
01552a
   fd = creat ("/var/spool/gdm/force-display-on-active-vt", 0644);
01552a
   close (fd);
01552a
 }
01552a
 #endif
01552a
 
01552a
 static void
01552a
 quit_program (state_t *state)
01552a
 {
01552a
   ply_trace ("cleaning up devices");
01552a
   ply_device_manager_free (state->device_manager);
01552a
 
01552a
   ply_trace ("exiting event loop");
01552a
   ply_event_loop_exit (state->loop, 0);
01552a
 
01552a
   if (pid_file != NULL)
01552a
     {
01552a
       unlink (pid_file);
01552a
       free (pid_file);
01552a
       pid_file = NULL;
01552a
-- 
01552a
2.7.4
01552a