Blob Blame History Raw
From 2d3dd0c3bea2c58cef2184c761da6457dcbcc857 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Mon, 29 Mar 2010 15:20:44 -0400
Subject: [PATCH 1/2] [main] watch keyboard input after displays are added

Since the boot splashes handle opening the terminal now,
we need to make sure that we don't try to watch for input on
the terminal until they've opened it.

This should fix some crashes users are reportedly seeing with
the details splash.

A potentially better fix would be to make watch_for_input defer
doing anything on its own using the terminal is opened.  That
would require a trigger and some new api to ply-terminal, I think.
---
 src/main.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/main.c b/src/main.c
index d3d670d..0646ad8 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1220,7 +1220,6 @@ set_keyboard (state_t        *state,
   ply_keyboard_add_enter_handler (keyboard,
                                   (ply_keyboard_enter_handler_t)
                                   on_enter, state);
-  ply_keyboard_watch_for_input (keyboard);
 }
 static void
 add_display_and_keyboard_for_terminal (state_t    *state,
@@ -1347,6 +1346,8 @@ add_displays_and_keyboard_to_boot_splash (state_t           *state,
 
       node = next_node;
     }
+
+  ply_keyboard_watch_for_input (state->keyboard);
 }
 
 static ply_boot_splash_t *
-- 
1.6.5.2


From 92cc20f82fbd0f650d8065204198b292b2f8153a Mon Sep 17 00:00:00 2001
From: Charlie Brej <cbrej@cs.man.ac.uk>
Date: Mon, 29 Mar 2010 22:56:11 +0100
Subject: [PATCH 2/2] [main] Watch keyboard input after the splash had a chance to quit

If the splash hasn't picked up any displays it will abort. We wait for the
possible abort before attaching the keyboard. This is a slight hack as now
add_displays_and_keyboard_to_boot_splash no longer adds the keyboards. Also the
splash plugin can access the keyboard before it is officially opened.

For now it just fixes the terminal fd < 0 assertion bug.
---
 src/main.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main.c b/src/main.c
index 0646ad8..0373c14 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1346,8 +1346,6 @@ add_displays_and_keyboard_to_boot_splash (state_t           *state,
 
       node = next_node;
     }
-
-  ply_keyboard_watch_for_input (state->keyboard);
 }
 
 static ply_boot_splash_t *
@@ -1396,6 +1394,8 @@ start_boot_splash (state_t    *state,
       return NULL;
     }
 
+  ply_keyboard_watch_for_input (state->keyboard);
+
   update_display (state);
   return splash;
 }
-- 
1.6.5.2