>From 10c123988308cea24384205d118af75fdc09635c Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Tue, 19 Dec 2023 12:25:24 +0100 Subject: [PATCH] Respect mouse-face on image glyphs (bug#67794) * src/xdisp.c (draw_glyphs): Maybe update image glyphs with mouse face features before drawing. --- src/xdisp.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/xdisp.c b/src/xdisp.c index 75d769600c4..cd9ce57c0da 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -30985,6 +30985,21 @@ draw_glyphs (struct window *w, int x, struct glyph_row *row, } } + /* Update image glyphs with mouse face features. */ + if (hl == DRAW_MOUSE_FACE) + { + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); + for (s = head; s; s = s->next) + if (s->first_glyph->type == IMAGE_GLYPH) + if (s->img) + { + ptrdiff_t id; + id = lookup_image (f, s->img->spec, hlinfo->mouse_face_face_id); + s->img = IMAGE_FROM_ID (f, id); + prepare_image_for_display(f, s->img); + } + } + /* Draw all strings. */ for (s = head; s; s = s->next) FRAME_RIF (f)->draw_glyph_string (s); -- 2.43.0