mirror of
https://gitlab.freedesktop.org/plymouth/plymouth.git
synced 2026-05-08 13:38:45 +02:00
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
This commit is contained in:
parent
a58ae9ba27
commit
84eb4381db
1 changed files with 13 additions and 4 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue