]> git.eshelyaron.com Git - emacs.git/commitdiff
More thorough fix for image slices on mode/header-line
authorEli Zaretskii <eliz@gnu.org>
Wed, 2 Apr 2025 13:12:03 +0000 (16:12 +0300)
committerEshel Yaron <me@eshelyaron.com>
Thu, 3 Apr 2025 16:51:05 +0000 (18:51 +0200)
* src/xdisp.c (note_mode_line_or_margin_highlight): Remove
correction of DX and DY due to image slices, as this is now done
in 'mode_line_string'.
* src/dispnew.c (mode_line_string): Make DX and DY account for
image slices.  (Bug#77429)

(cherry picked from commit a9661e643b1235e82b7ba0c9c9c2cd8fa533b5a6)

src/dispnew.c
src/xdisp.c

index 712994a95fbfa3d1f5c051738487def001a23fcc..ff14efe0c4aefa6fd4ac38e2850b5c101f9415d8 100644 (file)
@@ -6444,7 +6444,11 @@ mode_line_string (struct window *w, enum window_part part,
              struct image *img;
              img = IMAGE_OPT_FROM_ID (WINDOW_XFRAME (w), glyph->u.img_id);
              if (img != NULL)
-               *object = img->spec;
+               {
+                 *object = img->spec;
+                 x0 += glyph->slice.img.x;
+                 y0 += glyph->slice.img.y;
+               }
              y0 -= row->ascent - glyph->ascent;
            }
 #endif
index 2e5d306fbb7cd1df1959e0be4f87945878f432b4..9f6754a98ca2e2f25b4f0a7a43cc9f1587e030fb 100644 (file)
@@ -35864,15 +35864,6 @@ 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))