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