diff options
author | Ray Strode <rstrode@redhat.com> | 2014-07-14 08:04:54 -0400 |
---|---|---|
committer | Ray Strode <rstrode@redhat.com> | 2014-07-14 08:04:54 -0400 |
commit | 84eb4381db85877a9a56b35994e6c10d43e46ebe (patch) | |
tree | 321838745b955c705a3f27d41f7a304c4d86023a | |
parent | a58ae9ba27b6d2400b9d47e06ac8b32d24e28a14 (diff) |
seat: be a little more forgiving in the case there's no open terminal
We can end up in a situation where a seat object doesn't have a terminal
associated with it. In that case we shouldn't crash, but continue on
with no input available for that seat.
https://bugs.freedesktop.org/show_bug.cgi?id=80553
-rw-r--r-- | src/libply-splash-core/ply-seat.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/libply-splash-core/ply-seat.c b/src/libply-splash-core/ply-seat.c index 9cc689d3..700332fc 100644 --- a/src/libply-splash-core/ply-seat.c +++ b/src/libply-splash-core/ply-seat.c @@ -144,13 +144,22 @@ ply_seat_open (ply_seat_t *seat, if (seat->renderer != NULL) { seat->keyboard = ply_keyboard_new_for_renderer (seat->renderer); add_pixel_displays (seat); - } else { + } else if (seat->terminal != NULL) { seat->keyboard = ply_keyboard_new_for_terminal (seat->terminal); } - add_text_displays (seat); - ply_keyboard_watch_for_input (seat->keyboard); - seat->keyboard_active = true; + if (seat->terminal != NULL) { + add_text_displays (seat); + } else { + ply_trace ("not adding text display for seat, since seat has no associated terminal"); + } + + if (seat->keyboard != NULL) { + ply_keyboard_watch_for_input (seat->keyboard); + seat->keyboard_active = true; + } else { + ply_trace ("not watching seat for input"); + } return true; } |