aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dispnew.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/dispnew.c b/src/dispnew.c
index ad59704a168..cb32f09b7c6 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -66,7 +66,7 @@ struct dim
66 66
67/* Function prototypes. */ 67/* Function prototypes. */
68 68
69static void update_frame_line (struct frame *, int); 69static void update_frame_line (struct frame *, int, bool);
70static int required_matrix_height (struct window *); 70static int required_matrix_height (struct window *);
71static int required_matrix_width (struct window *); 71static int required_matrix_width (struct window *);
72static void increment_row_positions (struct glyph_row *, ptrdiff_t, ptrdiff_t); 72static void increment_row_positions (struct glyph_row *, ptrdiff_t, ptrdiff_t);
@@ -88,7 +88,7 @@ static void check_matrix_pointers (struct glyph_matrix *,
88static void mirror_line_dance (struct window *, int, int, int *, char *); 88static void mirror_line_dance (struct window *, int, int, int *, char *);
89static bool update_window_tree (struct window *, bool); 89static bool update_window_tree (struct window *, bool);
90static bool update_window (struct window *, bool); 90static bool update_window (struct window *, bool);
91static bool update_frame_1 (struct frame *, bool, bool, bool); 91static bool update_frame_1 (struct frame *, bool, bool, bool, bool);
92static bool scrolling (struct frame *); 92static bool scrolling (struct frame *);
93static void set_window_cursor_after_update (struct window *); 93static void set_window_cursor_after_update (struct window *);
94static void adjust_frame_glyphs_for_window_redisplay (struct frame *); 94static void adjust_frame_glyphs_for_window_redisplay (struct frame *);
@@ -3121,7 +3121,7 @@ update_frame (struct frame *f, bool force_p, bool inhibit_hairy_id_p)
3121 3121
3122 /* Update the display. */ 3122 /* Update the display. */
3123 update_begin (f); 3123 update_begin (f);
3124 paused_p = update_frame_1 (f, force_p, inhibit_hairy_id_p, 1); 3124 paused_p = update_frame_1 (f, force_p, inhibit_hairy_id_p, 1, false);
3125 update_end (f); 3125 update_end (f);
3126 3126
3127 if (FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f)) 3127 if (FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f))
@@ -3174,7 +3174,7 @@ update_frame_with_menu (struct frame *f, int row, int col)
3174 cursor_at_point_p = !(row >= 0 && col >= 0); 3174 cursor_at_point_p = !(row >= 0 && col >= 0);
3175 /* Force update_frame_1 not to stop due to pending input, and not 3175 /* Force update_frame_1 not to stop due to pending input, and not
3176 try scrolling. */ 3176 try scrolling. */
3177 paused_p = update_frame_1 (f, 1, 1, cursor_at_point_p); 3177 paused_p = update_frame_1 (f, 1, 1, cursor_at_point_p, true);
3178 /* ROW and COL tell us where in the menu to position the cursor, so 3178 /* ROW and COL tell us where in the menu to position the cursor, so
3179 that screen readers know the active region on the screen. */ 3179 that screen readers know the active region on the screen. */
3180 if (!cursor_at_point_p) 3180 if (!cursor_at_point_p)
@@ -4474,7 +4474,7 @@ scrolling_window (struct window *w, bool header_line_p)
4474 4474
4475static bool 4475static bool
4476update_frame_1 (struct frame *f, bool force_p, bool inhibit_id_p, 4476update_frame_1 (struct frame *f, bool force_p, bool inhibit_id_p,
4477 bool set_cursor_p) 4477 bool set_cursor_p, bool updating_menu_p)
4478{ 4478{
4479 /* Frame matrices to work on. */ 4479 /* Frame matrices to work on. */
4480 struct glyph_matrix *current_matrix = f->current_matrix; 4480 struct glyph_matrix *current_matrix = f->current_matrix;
@@ -4513,7 +4513,7 @@ update_frame_1 (struct frame *f, bool force_p, bool inhibit_id_p,
4513 4513
4514 /* Update the individual lines as needed. Do bottom line first. */ 4514 /* Update the individual lines as needed. Do bottom line first. */
4515 if (MATRIX_ROW_ENABLED_P (desired_matrix, desired_matrix->nrows - 1)) 4515 if (MATRIX_ROW_ENABLED_P (desired_matrix, desired_matrix->nrows - 1))
4516 update_frame_line (f, desired_matrix->nrows - 1); 4516 update_frame_line (f, desired_matrix->nrows - 1, updating_menu_p);
4517 4517
4518 /* Now update the rest of the lines. */ 4518 /* Now update the rest of the lines. */
4519 for (i = 0; i < desired_matrix->nrows - 1 && (force_p || !input_pending); i++) 4519 for (i = 0; i < desired_matrix->nrows - 1 && (force_p || !input_pending); i++)
@@ -4539,7 +4539,7 @@ update_frame_1 (struct frame *f, bool force_p, bool inhibit_id_p,
4539 if (!force_p && (i - 1) % preempt_count == 0) 4539 if (!force_p && (i - 1) % preempt_count == 0)
4540 detect_input_pending_ignore_squeezables (); 4540 detect_input_pending_ignore_squeezables ();
4541 4541
4542 update_frame_line (f, i); 4542 update_frame_line (f, i, updating_menu_p);
4543 } 4543 }
4544 } 4544 }
4545 4545
@@ -4775,7 +4775,7 @@ count_match (struct glyph *str1, struct glyph *end1, struct glyph *str2, struct
4775/* Perform a frame-based update on line VPOS in frame FRAME. */ 4775/* Perform a frame-based update on line VPOS in frame FRAME. */
4776 4776
4777static void 4777static void
4778update_frame_line (struct frame *f, int vpos) 4778update_frame_line (struct frame *f, int vpos, bool updating_menu_p)
4779{ 4779{
4780 struct glyph *obody, *nbody, *op1, *op2, *np1, *nend; 4780 struct glyph *obody, *nbody, *op1, *op2, *np1, *nend;
4781 int tem; 4781 int tem;
@@ -4814,6 +4814,12 @@ update_frame_line (struct frame *f, int vpos)
4814 current_row->enabled_p = true; 4814 current_row->enabled_p = true;
4815 current_row->used[TEXT_AREA] = desired_row->used[TEXT_AREA]; 4815 current_row->used[TEXT_AREA] = desired_row->used[TEXT_AREA];
4816 4816
4817 /* For some reason, cursor is sometimes moved behind our back when a
4818 frame with a TTY menu is redrawn. Homing the cursor as below
4819 fixes that. */
4820 if (updating_menu_p)
4821 cursor_to (f, 0, 0);
4822
4817 /* If desired line is empty, just clear the line. */ 4823 /* If desired line is empty, just clear the line. */
4818 if (!desired_row->enabled_p) 4824 if (!desired_row->enabled_p)
4819 { 4825 {