aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann2000-12-20 12:00:57 +0000
committerGerd Moellmann2000-12-20 12:00:57 +0000
commitc9f00270df3859ee0dfee5cee77896d1f8f8586b (patch)
tree905ccf2213d9ca82de21cb782b9a7c2788736081 /src
parentaa35ba9e180f0216dd31cf8baa8594b4bf2fab85 (diff)
downloademacs-c9f00270df3859ee0dfee5cee77896d1f8f8586b.tar.gz
emacs-c9f00270df3859ee0dfee5cee77896d1f8f8586b.zip
(fake_current_matrices, ensure_frame_matrix): New
functions. (adjust_frame_glyphs_for_frame_redisplay): If display has been completed, call fake_current_matrices instead of marking frame garbaged.
Diffstat (limited to 'src')
-rw-r--r--src/dispnew.c78
1 files changed, 73 insertions, 5 deletions
diff --git a/src/dispnew.c b/src/dispnew.c
index 721d5186b6c..d4f67ff704c 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -120,6 +120,7 @@ struct dim
120 120
121/* Function prototypes. */ 121/* Function prototypes. */
122 122
123static void fake_current_matrices P_ ((Lisp_Object));
123static void redraw_overlapping_rows P_ ((struct window *, int)); 124static void redraw_overlapping_rows P_ ((struct window *, int));
124static void redraw_overlapped_rows P_ ((struct window *, int)); 125static void redraw_overlapped_rows P_ ((struct window *, int));
125static int count_blanks P_ ((struct glyph *, int)); 126static int count_blanks P_ ((struct glyph *, int));
@@ -2001,6 +2002,70 @@ adjust_frame_glyphs (f)
2001} 2002}
2002 2003
2003 2004
2005/* In the window tree with root W, build current matrices of leaf
2006 windows from the frame's current matrix. */
2007
2008static void
2009fake_current_matrices (window)
2010 Lisp_Object window;
2011{
2012 struct window *w;
2013
2014 for (; !NILP (window); window = w->next)
2015 {
2016 w = XWINDOW (window);
2017
2018 if (!NILP (w->hchild))
2019 fake_current_matrices (w->hchild);
2020 else if (!NILP (w->vchild))
2021 fake_current_matrices (w->vchild);
2022 else
2023 {
2024 int i;
2025 struct frame *f = XFRAME (w->frame);
2026 struct glyph_matrix *m = w->current_matrix;
2027 struct glyph_matrix *fm = f->current_matrix;
2028
2029 xassert (m->matrix_h == XFASTINT (w->height));
2030 xassert (m->matrix_w == XFASTINT (w->width));
2031
2032 for (i = 0; i < m->matrix_h; ++i)
2033 {
2034 struct glyph_row *r = m->rows + i;
2035 struct glyph_row *fr = fm->rows + i + XFASTINT (w->top);
2036
2037 xassert (r->glyphs[TEXT_AREA] >= fr->glyphs[TEXT_AREA]
2038 && r->glyphs[LAST_AREA] <= fr->glyphs[LAST_AREA]);
2039
2040 r->enabled_p = fr->enabled_p;
2041 if (r->enabled_p)
2042 {
2043 r->used[LEFT_MARGIN_AREA] = m->left_margin_glyphs;
2044 r->used[RIGHT_MARGIN_AREA] = m->right_margin_glyphs;
2045 r->used[TEXT_AREA] = (m->matrix_w
2046 - r->used[LEFT_MARGIN_AREA]
2047 - r->used[RIGHT_MARGIN_AREA]);
2048 r->mode_line_p = 0;
2049 r->inverse_p = fr->inverse_p;
2050 }
2051 }
2052 }
2053 }
2054}
2055
2056
2057/* Make sure the current frame matrix of frame F has been built.
2058 This is a no-op if F doesn't use frame-based redisplay. */
2059
2060void
2061ensure_frame_matrix (f)
2062 struct frame *f;
2063{
2064 if (f->current_pool && display_completed)
2065 build_frame_matrix (f);
2066}
2067
2068
2004/* Allocate/reallocate glyph matrices of a single frame F for 2069/* Allocate/reallocate glyph matrices of a single frame F for
2005 frame-based redisplay. */ 2070 frame-based redisplay. */
2006 2071
@@ -2036,7 +2101,7 @@ adjust_frame_glyphs_for_frame_redisplay (f)
2036 f->desired_matrix = new_glyph_matrix (f->desired_pool); 2101 f->desired_matrix = new_glyph_matrix (f->desired_pool);
2037 f->current_matrix = new_glyph_matrix (f->current_pool); 2102 f->current_matrix = new_glyph_matrix (f->current_pool);
2038 } 2103 }
2039 2104
2040 /* Compute window glyph matrices. (This takes the mini-buffer 2105 /* Compute window glyph matrices. (This takes the mini-buffer
2041 window into account). The result is the size of the frame glyph 2106 window into account). The result is the size of the frame glyph
2042 matrix needed. The variable window_change_flags is set to a bit 2107 matrix needed. The variable window_change_flags is set to a bit
@@ -2076,10 +2141,13 @@ adjust_frame_glyphs_for_frame_redisplay (f)
2076 adjust_glyph_matrix (NULL, f->desired_matrix, 0, 0, matrix_dim); 2141 adjust_glyph_matrix (NULL, f->desired_matrix, 0, 0, matrix_dim);
2077 adjust_glyph_matrix (NULL, f->current_matrix, 0, 0, matrix_dim); 2142 adjust_glyph_matrix (NULL, f->current_matrix, 0, 0, matrix_dim);
2078 2143
2079 /* Since location and size of sub-matrices within the pool may 2144 /* If the display hasn't been interrupted, set up windows'
2080 have changed, and current matrices don't have meaningful 2145 current matrices so that they describe what's on the
2081 contents anymore, mark the frame garbaged. */ 2146 screen. */
2082 SET_FRAME_GARBAGED (f); 2147 if (display_completed)
2148 fake_current_matrices (FRAME_ROOT_WINDOW (f));
2149 else
2150 SET_FRAME_GARBAGED (f);
2083 } 2151 }
2084} 2152}
2085 2153