aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog2
-rw-r--r--src/dispnew.c73
2 files changed, 45 insertions, 30 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 403a60a7444..49ae3e66d29 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,7 @@
12001-01-26 Gerd Moellmann <gerd@gnu.org> 12001-01-26 Gerd Moellmann <gerd@gnu.org>
2 2
3 * dispnew.c (adjust_glyph_matrix): Always clear desired matrices.
4
3 * xdisp.c (display_line): Simplify check for glyphs fitting 5 * xdisp.c (display_line): Simplify check for glyphs fitting
4 entirely in the line. 6 entirely in the line.
5 7
diff --git a/src/dispnew.c b/src/dispnew.c
index c0471f2a31d..c7a65823819 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -775,44 +775,57 @@ adjust_glyph_matrix (w, matrix, x, y, dim)
775 matrix->nrows = dim.height; 775 matrix->nrows = dim.height;
776 xassert (matrix->nrows >= 0); 776 xassert (matrix->nrows >= 0);
777 777
778 /* Mark rows in a current matrix of a window as not having valid 778 if (w)
779 contents. It's important to not do this for desired matrices. 779 {
780 When Emacs starts, it may already be building desired matrices 780 if (matrix == w->current_matrix)
781 when this function runs. */
782 if (w && matrix == w->current_matrix)
783 {
784 if (window_width < 0)
785 window_width = window_box_width (w, -1);
786
787 /* Optimize the case that only the height has changed (C-x 2,
788 upper window). Invalidate all rows that are no longer part
789 of the window. */
790 if (!marginal_areas_changed_p
791 && matrix->window_left_x == XFASTINT (w->left)
792 && matrix->window_top_y == XFASTINT (w->top)
793 && matrix->window_width == window_box_width (w, -1))
794 { 781 {
795 i = 0; 782 /* Mark rows in a current matrix of a window as not having
796 while (matrix->rows[i].enabled_p 783 valid contents. It's important to not do this for
797 && (MATRIX_ROW_BOTTOM_Y (matrix->rows + i) 784 desired matrices. When Emacs starts, it may already be
798 < matrix->window_height)) 785 building desired matrices when this function runs. */
799 ++i; 786 if (window_width < 0)
800 787 window_width = window_box_width (w, -1);
801 /* Window end is invalid, if inside of the rows that 788
802 are invalidated. */ 789 /* Optimize the case that only the height has changed (C-x 2,
803 if (INTEGERP (w->window_end_vpos) 790 upper window). Invalidate all rows that are no longer part
804 && XFASTINT (w->window_end_vpos) >= i) 791 of the window. */
805 w->window_end_valid = Qnil; 792 if (!marginal_areas_changed_p
793 && matrix->window_left_x == XFASTINT (w->left)
794 && matrix->window_top_y == XFASTINT (w->top)
795 && matrix->window_width == window_box_width (w, -1))
796 {
797 i = 0;
798 while (matrix->rows[i].enabled_p
799 && (MATRIX_ROW_BOTTOM_Y (matrix->rows + i)
800 < matrix->window_height))
801 ++i;
802
803 /* Window end is invalid, if inside of the rows that
804 are invalidated. */
805 if (INTEGERP (w->window_end_vpos)
806 && XFASTINT (w->window_end_vpos) >= i)
807 w->window_end_valid = Qnil;
806 808
807 while (i < matrix->nrows) 809 while (i < matrix->nrows)
808 matrix->rows[i++].enabled_p = 0; 810 matrix->rows[i++].enabled_p = 0;
811 }
812 else
813 {
814 for (i = 0; i < matrix->nrows; ++i)
815 matrix->rows[i].enabled_p = 0;
816 }
809 } 817 }
810 else 818 else if (matrix == w->desired_matrix)
811 { 819 {
820 /* Rows in desired matrices always have to be cleared;
821 redisplay expects this is the case when it runs, so it
822 had better be the case when we adjust matrices between
823 redisplays. */
812 for (i = 0; i < matrix->nrows; ++i) 824 for (i = 0; i < matrix->nrows; ++i)
813 matrix->rows[i].enabled_p = 0; 825 matrix->rows[i].enabled_p = 0;
814 } 826 }
815 } 827 }
828
816 829
817 /* Remember last values to be able to optimize frame redraws. */ 830 /* Remember last values to be able to optimize frame redraws. */
818 matrix->matrix_x = x; 831 matrix->matrix_x = x;