aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2021-03-13 17:00:15 +0200
committerEli Zaretskii2021-03-13 17:00:15 +0200
commit1f0fb1f6fa50faf67ffaaee0e52d00144883821e (patch)
tree11567c346695f2bd7278444930a14f341c85592b /src
parent8415a9513085d1c307610e2275655699cf7a55d5 (diff)
downloademacs-1f0fb1f6fa50faf67ffaaee0e52d00144883821e.tar.gz
emacs-1f0fb1f6fa50faf67ffaaee0e52d00144883821e.zip
Fix rare redisplay glitches when image has been removed from display
* src/dispnew.c (update_window): Make sure all glyph rows below the last visible one are marked as invalid, even when the loop which "updates the rest of the lines" didn't examine the last visible row. (Bug#47093)
Diffstat (limited to 'src')
-rw-r--r--src/dispnew.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/dispnew.c b/src/dispnew.c
index b3e4587250f..f613f7b6568 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -3588,6 +3588,7 @@ update_window (struct window *w, bool force_p)
3588 int yb; 3588 int yb;
3589 bool changed_p = 0, mouse_face_overwritten_p = 0; 3589 bool changed_p = 0, mouse_face_overwritten_p = 0;
3590 int n_updated = 0; 3590 int n_updated = 0;
3591 bool invisible_rows_marked = false;
3591 3592
3592#ifdef HAVE_WINDOW_SYSTEM 3593#ifdef HAVE_WINDOW_SYSTEM
3593 gui_update_window_begin (w); 3594 gui_update_window_begin (w);
@@ -3679,13 +3680,36 @@ update_window (struct window *w, bool force_p)
3679 tempted to optimize redisplay based on lines displayed 3680 tempted to optimize redisplay based on lines displayed
3680 in the first redisplay. */ 3681 in the first redisplay. */
3681 if (MATRIX_ROW_BOTTOM_Y (row) >= yb) 3682 if (MATRIX_ROW_BOTTOM_Y (row) >= yb)
3682 for (i = vpos + 1; i < w->current_matrix->nrows - 1; ++i) 3683 {
3683 SET_MATRIX_ROW_ENABLED_P (w->current_matrix, i, false); 3684 for (i = vpos + 1; i < w->current_matrix->nrows - 1; ++i)
3685 SET_MATRIX_ROW_ENABLED_P (w->current_matrix, i, false);
3686 invisible_rows_marked = true;
3687 }
3684 } 3688 }
3685 3689
3686 /* Was display preempted? */ 3690 /* Was display preempted? */
3687 paused_p = row < end; 3691 paused_p = row < end;
3688 3692
3693 if (!paused_p && !invisible_rows_marked)
3694 {
3695 /* If we didn't mark the invisible rows in the current
3696 matrix as invalid above, do that now. This can happen if
3697 scrolling_window updates the last visible rows of the
3698 current matrix, in which case the above loop doesn't get
3699 to examine the last visible row. */
3700 int i;
3701 for (i = 0; i < w->current_matrix->nrows - 1; ++i)
3702 {
3703 struct glyph_row *current_row = MATRIX_ROW (w->current_matrix, i);
3704 if (current_row->enabled_p
3705 && MATRIX_ROW_BOTTOM_Y (current_row) >= yb)
3706 {
3707 for (++i ; i < w->current_matrix->nrows - 1; ++i)
3708 SET_MATRIX_ROW_ENABLED_P (w->current_matrix, i, false);
3709 }
3710 }
3711 }
3712
3689 set_cursor: 3713 set_cursor:
3690 3714
3691 /* Update the tab line after scrolling because a new tab 3715 /* Update the tab line after scrolling because a new tab