comparison src/dispnew.c @ 77267:7f8bdfdc0227

(adjust_frame_glyphs_for_frame_redisplay): Set garbaged flag in presence of window margins. (showing_window_margins_p): New function.
author Chong Yidong <cyd@stupidchicken.com>
date Mon, 16 Apr 2007 16:24:33 +0000
parents 685fa6c9ae44
children 922696f363b0 dc002877ce12 e6fdae9180d4
comparison
equal deleted inserted replaced
77266:3a89991fd0a7 77267:7f8bdfdc0227
118 118
119 /* Function prototypes. */ 119 /* Function prototypes. */
120 120
121 static struct glyph_matrix *save_current_matrix P_ ((struct frame *)); 121 static struct glyph_matrix *save_current_matrix P_ ((struct frame *));
122 static void restore_current_matrix P_ ((struct frame *, struct glyph_matrix *)); 122 static void restore_current_matrix P_ ((struct frame *, struct glyph_matrix *));
123 static int showing_window_margins_p P_ ((struct window *));
123 static void fake_current_matrices P_ ((Lisp_Object)); 124 static void fake_current_matrices P_ ((Lisp_Object));
124 static void redraw_overlapping_rows P_ ((struct window *, int)); 125 static void redraw_overlapping_rows P_ ((struct window *, int));
125 static void redraw_overlapped_rows P_ ((struct window *, int)); 126 static void redraw_overlapped_rows P_ ((struct window *, int));
126 static int count_blanks P_ ((struct glyph *, int)); 127 static int count_blanks P_ ((struct glyph *, int));
127 static int count_match P_ ((struct glyph *, struct glyph *, 128 static int count_match P_ ((struct glyph *, struct glyph *,
2162 adjust_decode_mode_spec_buffer (f); 2163 adjust_decode_mode_spec_buffer (f);
2163 2164
2164 f->glyphs_initialized_p = 1; 2165 f->glyphs_initialized_p = 1;
2165 } 2166 }
2166 2167
2168 /* Return 1 if any window in the tree has nonzero window margins. See
2169 the hack at the end of adjust_frame_glyphs_for_frame_redisplay. */
2170 static int
2171 showing_window_margins_p (w)
2172 struct window *w;
2173 {
2174 while (w)
2175 {
2176 if (!NILP (w->hchild))
2177 {
2178 if (showing_window_margins_p (XWINDOW (w->hchild)))
2179 return 1;
2180 }
2181 else if (!NILP (w->vchild))
2182 {
2183 if (showing_window_margins_p (XWINDOW (w->vchild)))
2184 return 1;
2185 }
2186 else if (!NILP (w->left_margin_cols)
2187 || !NILP (w->right_margin_cols))
2188 return 1;
2189
2190 w = NILP (w->next) ? 0 : XWINDOW (w->next);
2191 }
2192 return 0;
2193 }
2194
2167 2195
2168 /* In the window tree with root W, build current matrices of leaf 2196 /* In the window tree with root W, build current matrices of leaf
2169 windows from the frame's current matrix. */ 2197 windows from the frame's current matrix. */
2170 2198
2171 static void 2199 static void
2349 make a copy of the current glyphs, and restore the current 2377 make a copy of the current glyphs, and restore the current
2350 matrix' contents from that copy. */ 2378 matrix' contents from that copy. */
2351 if (display_completed 2379 if (display_completed
2352 && !FRAME_GARBAGED_P (f) 2380 && !FRAME_GARBAGED_P (f)
2353 && matrix_dim.width == f->current_matrix->matrix_w 2381 && matrix_dim.width == f->current_matrix->matrix_w
2354 && matrix_dim.height == f->current_matrix->matrix_h) 2382 && matrix_dim.height == f->current_matrix->matrix_h
2383 /* For some reason, the frame glyph matrix gets corrupted if
2384 any of the windows contain margins. I haven't been able
2385 to hunt down the reason, but for the moment this prevents
2386 the problem from manifesting. -- cyd */
2387 && !showing_window_margins_p (XWINDOW (FRAME_ROOT_WINDOW (f))))
2355 { 2388 {
2356 struct glyph_matrix *copy = save_current_matrix (f); 2389 struct glyph_matrix *copy = save_current_matrix (f);
2357 adjust_glyph_matrix (NULL, f->desired_matrix, 0, 0, matrix_dim); 2390 adjust_glyph_matrix (NULL, f->desired_matrix, 0, 0, matrix_dim);
2358 adjust_glyph_matrix (NULL, f->current_matrix, 0, 0, matrix_dim); 2391 adjust_glyph_matrix (NULL, f->current_matrix, 0, 0, matrix_dim);
2359 restore_current_matrix (f, copy); 2392 restore_current_matrix (f, copy);