diff options
| author | Chong Yidong | 2007-04-16 16:24:33 +0000 |
|---|---|---|
| committer | Chong Yidong | 2007-04-16 16:24:33 +0000 |
| commit | 075757ccc6ad2c7d3df1a1e70a7d56dbf3d29757 (patch) | |
| tree | d9d3d76fe985cfc9f89ae0b9440f145cb102b2ec | |
| parent | 30603ba1d66c293acd7d9723c974a4b136b98a36 (diff) | |
| download | emacs-075757ccc6ad2c7d3df1a1e70a7d56dbf3d29757.tar.gz emacs-075757ccc6ad2c7d3df1a1e70a7d56dbf3d29757.zip | |
(adjust_frame_glyphs_for_frame_redisplay): Set garbaged flag in
presence of window margins.
(showing_window_margins_p): New function.
| -rw-r--r-- | src/dispnew.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/src/dispnew.c b/src/dispnew.c index a7efa8249ba..bd63c473cf8 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -120,6 +120,7 @@ struct dim | |||
| 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)); |
| @@ -2164,6 +2165,33 @@ adjust_frame_glyphs (f) | |||
| 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. */ |
| @@ -2351,7 +2379,12 @@ adjust_frame_glyphs_for_frame_redisplay (f) | |||
| 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); |