From 335a660b4b725eb76abfa5d80295ac5c7be5d205 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 31 Oct 2021 09:42:09 +0200 Subject: [PATCH] Fix display glitches with side-by-side windows on TTY frames * src/dispnew.c (adjust_glyph_matrix, prepare_desired_row): Leave room for the border glyph only if the window does actually have the right margin. (Bug#51521) --- src/dispnew.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/dispnew.c b/src/dispnew.c index 69c2023fdf3..53eb8984747 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -475,7 +475,8 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y = row->glyphs[TEXT_AREA] + dim.width - left - right; /* Leave room for a border glyph. */ if (!FRAME_WINDOW_P (XFRAME (w->frame)) - && !WINDOW_RIGHTMOST_P (w)) + && !WINDOW_RIGHTMOST_P (w) + && right > 0) row->glyphs[RIGHT_MARGIN_AREA] -= 1; row->glyphs[LAST_AREA] = row->glyphs[LEFT_MARGIN_AREA] + dim.width; @@ -1148,7 +1149,8 @@ prepare_desired_row (struct window *w, struct glyph_row *row, bool mode_line_p) row->glyphs[RIGHT_MARGIN_AREA] = row->glyphs[LAST_AREA] - right; /* Leave room for a border glyph. */ if (!FRAME_WINDOW_P (XFRAME (w->frame)) - && !WINDOW_RIGHTMOST_P (w)) + && !WINDOW_RIGHTMOST_P (w) + && right > 0) row->glyphs[RIGHT_MARGIN_AREA] -= 1; } } -- 2.39.2