mirror of
https://gitlab.freedesktop.org/plymouth/plymouth.git
synced 2026-05-08 12:28:12 +02:00
main: don't allow ESC key repeat to flood console
If the user holds down ESC the system can easily get overrun toggling details and the theme back and forth. This commit changes the code to ignore any ESC key events that come in while ESC is getting processed.
This commit is contained in:
parent
63148b20a1
commit
1f1d83bf71
1 changed files with 18 additions and 1 deletions
19
src/main.c
19
src/main.c
|
|
@ -102,6 +102,7 @@ typedef struct
|
|||
ply_terminal_t *local_console_terminal;
|
||||
ply_device_manager_t *device_manager;
|
||||
|
||||
ply_trigger_t *details_trigger;
|
||||
ply_trigger_t *deactivate_trigger;
|
||||
ply_trigger_t *quit_trigger;
|
||||
|
||||
|
|
@ -1500,8 +1501,24 @@ toggle_between_splash_and_details (state_t *state)
|
|||
static void
|
||||
on_escape_pressed (state_t *state)
|
||||
{
|
||||
|
||||
if (state->details_trigger != NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
state->details_trigger = ply_trigger_new (&state->details_trigger);
|
||||
|
||||
ply_trigger_add_handler (state->details_trigger,
|
||||
(ply_trigger_handler_t)
|
||||
toggle_between_splash_details,
|
||||
state);
|
||||
|
||||
ply_trace ("escape key pressed");
|
||||
toggle_between_splash_and_details (state);
|
||||
ply_event_loop_watch_for_timeout (state->loop,
|
||||
0.01,
|
||||
(ply_event_loop_timeout_handler_t)
|
||||
ply_trigger_pull
|
||||
state->details_trigger);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue