From: Eli Zaretskii Date: Sun, 31 Oct 2021 07:42:09 +0000 (+0200) Subject: Fix display glitches with side-by-side windows on TTY frames X-Git-Tag: emacs-28.0.90~150 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=335a660b4b;p=emacs.git 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) --- 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; } }