From 19d2ba00596b8ee31cff046b2387580b016fa4c5 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 4 Nov 2018 16:01:09 +0200 Subject: A further fix for locally remapped fringe face * src/xdisp.c (expose_window): Temporarily switch to the window's buffer, in case the fringe face was remapped locally in that buffer. (Bug#33244) --- src/xdisp.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/xdisp.c') diff --git a/src/xdisp.c b/src/xdisp.c index 7b0ca477220..fa7691cdd0f 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -32252,6 +32252,18 @@ expose_window (struct window *w, XRectangle *fr) y0 or y1 is negative (can happen for tall images). */ int r_bottom = r.y + r.height; + /* We must temporarily switch to the window's buffer, in case + the fringe face has been remapped in that buffer's + face-remapping-alist, so that draw_row_fringe_bitmaps, + called from expose_line, will use the right face. */ + bool buffer_changed = false; + struct buffer *oldbuf = current_buffer; + if (!w->pseudo_window_p) + { + set_buffer_internal_1 (XBUFFER (w->contents)); + buffer_changed = true; + } + /* Update lines intersecting rectangle R. */ first_overlapping_row = last_overlapping_row = NULL; for (row = w->current_matrix->rows; @@ -32297,6 +32309,9 @@ expose_window (struct window *w, XRectangle *fr) break; } + if (buffer_changed) + set_buffer_internal_1 (oldbuf); + /* Display the mode line if there is one. */ if (window_wants_mode_line (w) && (row = MATRIX_MODE_LINE_ROW (w->current_matrix), -- cgit v1.2.1