aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2019-10-08 16:57:23 +0300
committerEli Zaretskii2019-10-08 16:57:23 +0300
commit6469f9cd9290c2ed3317b1fd4fbb4288295b327f (patch)
treec3aef214d57ac5bbd1dae9529e4d1d31638539ee
parent304d022a66f2c71ee643021db69c1c99d135df55 (diff)
downloademacs-6469f9cd9290c2ed3317b1fd4fbb4288295b327f.tar.gz
emacs-6469f9cd9290c2ed3317b1fd4fbb4288295b327f.zip
Fix crashes on TTY frames due to "C-x 6 f"
* src/xdisp.c (redisplay_internal): Revert the recent change regarding TTY frames' garbaged flag. It is not needed. * src/dispnew.c (adjust_frame_glyphs_for_frame_redisplay): When returning due to mismatch between the desired and actual dimensions of the glyph matrix, set the frame's garbaged flag for TTY frames. This avoids crashes when we are later called from redisplay. Reported by Ergus <spacibba@aol.com>.
-rw-r--r--src/dispnew.c14
-rw-r--r--src/xdisp.c2
2 files changed, 14 insertions, 2 deletions
diff --git a/src/dispnew.c b/src/dispnew.c
index 4cf131522ec..4dd5ee2a1e0 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -2051,7 +2051,19 @@ adjust_frame_glyphs_for_frame_redisplay (struct frame *f)
2051 to the frame width (from CHANGE_FRAME_SIZE_1). */ 2051 to the frame width (from CHANGE_FRAME_SIZE_1). */
2052 if (matrix_dim.width != FRAME_TOTAL_COLS (f) 2052 if (matrix_dim.width != FRAME_TOTAL_COLS (f)
2053 || matrix_dim.height != FRAME_TOTAL_LINES (f)) 2053 || matrix_dim.height != FRAME_TOTAL_LINES (f))
2054 return; 2054 {
2055 /* We have reallocated the frame's glyph pools, but didn't
2056 update the glyph pointers in the frame's glyph matrices
2057 to use the reallocated pools (that happens below, in the
2058 call to adjust_glyph_matrix). Set the frame's garbaged
2059 flag, so that when we are called again from
2060 redisplay_internal, we don't erroneously call
2061 save_current_matrix, because it will use the wrong glyph
2062 pointers, and will most probably crash. */
2063 if (!FRAME_WINDOW_P (f) && pool_changed_p)
2064 SET_FRAME_GARBAGED (f);
2065 return;
2066 }
2055 2067
2056 eassert (matrix_dim.width == FRAME_TOTAL_COLS (f) 2068 eassert (matrix_dim.width == FRAME_TOTAL_COLS (f)
2057 && matrix_dim.height == FRAME_TOTAL_LINES (f)); 2069 && matrix_dim.height == FRAME_TOTAL_LINES (f));
diff --git a/src/xdisp.c b/src/xdisp.c
index 29d49d57dfd..1586a02e3d4 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -15684,7 +15684,7 @@ redisplay_internal (void)
15684 the frame. Don't do that on TTY frames, since we 15684 the frame. Don't do that on TTY frames, since we
15685 need to keep the garbaged flag in that case when 15685 need to keep the garbaged flag in that case when
15686 the frame has been resized. */ 15686 the frame has been resized. */
15687 if (FRAME_WINDOW_P (f) && FRAME_GARBAGED_P (f)) 15687 if (FRAME_GARBAGED_P (f))
15688 { 15688 {
15689 fset_redisplay (f); 15689 fset_redisplay (f);
15690 f->garbaged = false; 15690 f->garbaged = false;