bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#67794: 30.0.50; mouse-face is not respected on SVG images


From: Alan Third
Subject: bug#67794: 30.0.50; mouse-face is not respected on SVG images
Date: Tue, 12 Dec 2023 14:43:08 +0000

On Tue, Dec 12, 2023 at 03:07:13PM +0100, Manuel Giraud wrote:
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> [...]
> 
> >> Now a 'C-s foobar' shows the matched string respecting the isearch face
> >> even on the SVG image.  But when, you move your mouse over the "foobar"
> >> string, the SVG image keeps the foreground and background of the default
> >> face.
> >
> > I think we only support colors from 'face' properties on SVG images,
> > not from 'mouse-face'.  Alan, am I right?

Yes, that's right.

> > Basically, SVG images specify their own background color, and the
> > Emacs display cannot override that, since the image is generated by
> > librsvg.  So to change the background color, we wrap the SVG in
> > another SVG, see svg_load_image.  This way, the SVG spec submitted to
> > librsvg specifies different colors according to what Emacs wants.  And
> > we only do that for colors that come from 'face' properties.
> 
> This means that when you do a 'C-s foobar' and that the SVG is correctly
> displayed with the isearch face (foreground and background), such an
> embedded SVG was created on the fly?  If so, I think we should do the
> same for mouse-face too because this SVG generation is very fast!

I don't see any reason why we shouldn't do that.

lookup_image in image.c is where most of the work is done. It takes a
face ID number. There are three calls to it from xdisp.c. I don't know
if it would be best to change the callers to pass in the mouse face
instead of the local face, or to pass in the mouse face as well as the
local face and then allow lookup_image to work it out.

This assumes the mouse face details have been worked out before the
calls to lookup_image, I don't know much about how it works.

-- 
Alan Third





reply via email to

[Prev in Thread] Current Thread [Next in Thread]