Mercurial > emacs
comparison src/dispnew.c @ 35609:83f1f7fbe26e
(adjust_glyph_matrix): Always clear desired matrices.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Fri, 26 Jan 2001 14:19:03 +0000 |
parents | 9af454aee182 |
children | 32198b7c21e1 |
comparison
equal
deleted
inserted
replaced
35608:eeddccbbaa9f | 35609:83f1f7fbe26e |
---|---|
773 | 773 |
774 /* Number of rows to be used by MATRIX. */ | 774 /* Number of rows to be used by MATRIX. */ |
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. */ | 781 { |
782 if (w && matrix == w->current_matrix) | 782 /* Mark rows in a current matrix of a window as not having |
783 { | 783 valid contents. It's important to not do this for |
784 if (window_width < 0) | 784 desired matrices. When Emacs starts, it may already be |
785 window_width = window_box_width (w, -1); | 785 building desired matrices when this function runs. */ |
786 if (window_width < 0) | |
787 window_width = window_box_width (w, -1); | |
786 | 788 |
787 /* Optimize the case that only the height has changed (C-x 2, | 789 /* Optimize the case that only the height has changed (C-x 2, |
788 upper window). Invalidate all rows that are no longer part | 790 upper window). Invalidate all rows that are no longer part |
789 of the window. */ | 791 of the window. */ |
790 if (!marginal_areas_changed_p | 792 if (!marginal_areas_changed_p |
791 && matrix->window_left_x == XFASTINT (w->left) | 793 && matrix->window_left_x == XFASTINT (w->left) |
792 && matrix->window_top_y == XFASTINT (w->top) | 794 && matrix->window_top_y == XFASTINT (w->top) |
793 && matrix->window_width == window_box_width (w, -1)) | 795 && matrix->window_width == window_box_width (w, -1)) |
794 { | 796 { |
795 i = 0; | 797 i = 0; |
796 while (matrix->rows[i].enabled_p | 798 while (matrix->rows[i].enabled_p |
797 && (MATRIX_ROW_BOTTOM_Y (matrix->rows + i) | 799 && (MATRIX_ROW_BOTTOM_Y (matrix->rows + i) |
798 < matrix->window_height)) | 800 < matrix->window_height)) |
799 ++i; | 801 ++i; |
800 | 802 |
801 /* Window end is invalid, if inside of the rows that | 803 /* Window end is invalid, if inside of the rows that |
802 are invalidated. */ | 804 are invalidated. */ |
803 if (INTEGERP (w->window_end_vpos) | 805 if (INTEGERP (w->window_end_vpos) |
804 && XFASTINT (w->window_end_vpos) >= i) | 806 && XFASTINT (w->window_end_vpos) >= i) |
805 w->window_end_valid = Qnil; | 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; |
809 } | 811 } |
810 else | 812 else |
811 { | 813 { |
814 for (i = 0; i < matrix->nrows; ++i) | |
815 matrix->rows[i].enabled_p = 0; | |
816 } | |
817 } | |
818 else if (matrix == w->desired_matrix) | |
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; |
819 matrix->matrix_y = y; | 832 matrix->matrix_y = y; |
820 matrix->matrix_w = dim.width; | 833 matrix->matrix_w = dim.width; |