comparison src/dispnew.c @ 38489:19cb32759a2a

(update_window): Don't set the cursor at the end of the update if display update has been paused.
author Gerd Moellmann <gerd@gnu.org>
date Thu, 19 Jul 2001 13:16:14 +0000
parents db78c8220a21
children c867615c6a26
comparison
equal deleted inserted replaced
38488:2a70c922f6ad 38489:19cb32759a2a
4051 the update. */ 4051 the update. */
4052 if (force_p || !input_pending || !NILP (do_mouse_tracking)) 4052 if (force_p || !input_pending || !NILP (do_mouse_tracking))
4053 { 4053 {
4054 struct glyph_row *row, *end; 4054 struct glyph_row *row, *end;
4055 struct glyph_row *mode_line_row; 4055 struct glyph_row *mode_line_row;
4056 struct glyph_row *header_line_row = NULL; 4056 struct glyph_row *header_line_row;
4057 int yb, changed_p = 0, mouse_face_overwritten_p = 0, n_updated; 4057 int yb, changed_p = 0, mouse_face_overwritten_p = 0, n_updated;
4058 4058
4059 rif->update_window_begin_hook (w); 4059 rif->update_window_begin_hook (w);
4060 yb = window_text_bottom_y (w); 4060 yb = window_text_bottom_y (w);
4061 4061
4062 /* If window has a top line, update it before everything else. 4062 /* If window has a top line, update it before everything else.
4063 Adjust y-positions of other rows by the top line height. */ 4063 Adjust y-positions of other rows by the top line height. */
4064 row = desired_matrix->rows; 4064 row = desired_matrix->rows;
4065 end = row + desired_matrix->nrows - 1; 4065 end = row + desired_matrix->nrows - 1;
4066
4066 if (row->mode_line_p) 4067 if (row->mode_line_p)
4067 header_line_row = row++; 4068 {
4069 header_line_row = row;
4070 ++row;
4071 }
4072 else
4073 header_line_row = NULL;
4068 4074
4069 /* Update the mode line, if necessary. */ 4075 /* Update the mode line, if necessary. */
4070 mode_line_row = MATRIX_MODE_LINE_ROW (desired_matrix); 4076 mode_line_row = MATRIX_MODE_LINE_ROW (desired_matrix);
4071 if (mode_line_row->mode_line_p && mode_line_row->enabled_p) 4077 if (mode_line_row->mode_line_p && mode_line_row->enabled_p)
4072 { 4078 {
4083 while (row < end && !row->enabled_p) 4089 while (row < end && !row->enabled_p)
4084 ++row; 4090 ++row;
4085 4091
4086 /* Try reusing part of the display by copying. */ 4092 /* Try reusing part of the display by copying. */
4087 if (row < end && !desired_matrix->no_scrolling_p) 4093 if (row < end && !desired_matrix->no_scrolling_p)
4088 if (scrolling_window (w, header_line_row != NULL) > 0) 4094 {
4089 force_p = changed_p = 1; 4095 int rc = scrolling_window (w, header_line_row != NULL);
4096 if (rc < 0)
4097 {
4098 /* All rows were found to be equal. */
4099 paused_p = 0;
4100 goto set_cursor;
4101 }
4102 else if (rc > 0)
4103 /* We've scrolled the display. */
4104 force_p = 1;
4105 changed_p = 1;
4106 }
4090 4107
4091 /* Update the top mode line after scrolling because a new top 4108 /* Update the top mode line after scrolling because a new top
4092 line would otherwise overwrite lines at the top of the window 4109 line would otherwise overwrite lines at the top of the window
4093 that can be scrolled. */ 4110 that can be scrolled. */
4094 if (header_line_row && header_line_row->enabled_p) 4111 if (header_line_row && header_line_row->enabled_p)
4130 } 4147 }
4131 4148
4132 /* Was display preempted? */ 4149 /* Was display preempted? */
4133 paused_p = row < end; 4150 paused_p = row < end;
4134 4151
4152 set_cursor:
4153
4135 /* Fix the appearance of overlapping(overlapped rows. */ 4154 /* Fix the appearance of overlapping(overlapped rows. */
4136 if (!paused_p && !w->pseudo_window_p) 4155 if (!paused_p && !w->pseudo_window_p)
4137 { 4156 {
4138 if (changed_p && rif->fix_overlapping_area) 4157 if (changed_p && rif->fix_overlapping_area)
4139 { 4158 {
4153 #if GLYPH_DEBUG 4172 #if GLYPH_DEBUG
4154 /* Remember the redisplay method used to display the matrix. */ 4173 /* Remember the redisplay method used to display the matrix. */
4155 strcpy (w->current_matrix->method, w->desired_matrix->method); 4174 strcpy (w->current_matrix->method, w->desired_matrix->method);
4156 #endif 4175 #endif
4157 4176
4158 /* End of update of window W. */ 4177 /* End the update of window W. Don't set the cursor if we
4159 rif->update_window_end_hook (w, 1, mouse_face_overwritten_p); 4178 paused updating the display because in this case,
4179 set_window_cursor_after_update hasn't been called, and
4180 output_cursor doesn't contain the cursor location. */
4181 rif->update_window_end_hook (w, !paused_p, mouse_face_overwritten_p);
4160 } 4182 }
4161 else 4183 else
4162 paused_p = 1; 4184 paused_p = 1;
4163 4185
4164 #if GLYPH_DEBUG 4186 #if GLYPH_DEBUG