From: Gerd Möllmann Date: Tue, 21 Jan 2025 19:40:19 +0000 (+0100) Subject: Improve copying current glyphs when building frame matrix X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=830cb0d17ad09dd0e1f8bc2b508403deb6dc7495;p=emacs.git Improve copying current glyphs when building frame matrix * src/dispnew.c (build_frame_matrix_from_leaf_window): Don't make space glyphs. More comments. (cherry picked from commit d30f40868bf260692c7702e43b439d592b830e16) --- diff --git a/src/dispnew.c b/src/dispnew.c index ff413fab574..b65f0c1c62a 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -2624,22 +2624,27 @@ build_frame_matrix_from_leaf_window (struct glyph_matrix *frame_matrix, struct w current_row_p = 1; } + /* If someone asks why we are copying current glyphs here, and + maybe never enable the desired frame row we copy to: + + - there might be a window to the right of this one that has a + corresponding desired window row. + - we need the complete frame row for scrolling. */ if (current_row_p) { - /* If the desired glyphs for this row haven't been built, - copy from the corresponding current row, but only if it - is enabled, because ottherwise its contents are invalid. */ + /* If the desired glyphs for this row haven't been built, copy + from the corresponding current row. If that row is not + enabled, its contents might be invalid. Make sure that + glyphs have valid frames set in that case. This is closer + to what we did before child frames were added, and seems to + be something tty redisplay implicitly relies on. */ struct glyph *to = frame_row->glyphs[TEXT_AREA] + window_matrix->matrix_x; struct glyph *from = window_row->glyphs[0]; for (int i = 0; i < window_matrix->matrix_w; ++i) { - if (window_row->enabled_p) - to[i] = from[i]; - else - { - to[i] = space_glyph; - to[i].frame = f; - } + to[i] = from[i]; + if (!window_row->enabled_p) + to[i].frame = f; } } else