]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix :map property on sliced images on mode line and header line
authorEli Zaretskii <eliz@gnu.org>
Tue, 1 Apr 2025 15:40:59 +0000 (18:40 +0300)
committerEshel Yaron <me@eshelyaron.com>
Thu, 3 Apr 2025 16:50:06 +0000 (18:50 +0200)
* src/xdisp.c (note_mode_line_or_margin_highlight): Fix coordinates
for image slices wrt ':map' keyword when the image is on the mode
line or header line.  (Bug#77429)

(cherry picked from commit 975d58c4c8d22555a702c418bb68225e6fc630d0)

src/xdisp.c

index 9f6754a98ca2e2f25b4f0a7a43cc9f1587e030fb..2e5d306fbb7cd1df1959e0be4f87945878f432b4 100644 (file)
@@ -35864,6 +35864,15 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y,
 #ifdef HAVE_WINDOW_SYSTEM
   if (IMAGEP (object))
     {
+      if (glyph != NULL && glyph->type == IMAGE_GLYPH)
+       {
+         struct image *img = IMAGE_OPT_FROM_ID (f, glyph->u.img_id);
+         if (img != NULL && IMAGEP (img->spec))
+           {
+             dx += glyph->slice.img.x;
+             dy += glyph->slice.img.y;
+           }
+       }
       Lisp_Object image_map, hotspot;
       if ((image_map = plist_get (XCDR (object), QCmap),
           !NILP (image_map))