Commit 58ecdad0 authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

Prevent timers from messing up TTY menus

* src/term.c (tty_menu_activate): Inhibit redisplay for as long as
the TTY menu is open.  (Bug#21530)
parent 9fa9bc6a
......@@ -3117,6 +3117,7 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx,
Lisp_Object selectface;
int first_item = 0;
int col, row;
Lisp_Object prev_inhibit_redisplay = Vinhibit_redisplay;
/* Don't allow non-positive x0 and y0, lest the menu will wrap
......@@ -3159,6 +3160,11 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx,
buffers_num_deleted = 1;
/* Inhibit redisplay for as long as the menu is active, to avoid
messing the screen if some timer calls sit-for or a similar
function. */
Vinhibit_redisplay = Qt;
/* Force update of the current frame, so that the desired and the
current matrices are identical. */
update_frame_with_menu (sf, -1, -1);
......@@ -3349,6 +3355,7 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx,
if (!kbd_buffer_events_waiting ())
clear_input_pending ();
Vinhibit_redisplay = prev_inhibit_redisplay;
return result;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment