I experience some weird behavior with tooltips:
(progn
(let* ((start (point))
(end (progn (insert "test") (point)))
(ov (make-overlay start end)))
(overlay-put ov 'help-echo
(propertize "xxx" 'display '(image :type jpeg :file "~/foo.jpg"))))
(display-buffer-other-frame (get-buffer-create "dummy")))
Evaluating this code and moving the mouse pointer over test
I get a tooltip
displaying the image file foo.jpg
. The tooltip appears as a box with a
light yellow background color with sharp corners.
But the moment I click into any frame/window the tooltip changes. Now
the tooltip contains no image but the text xxx
. Furthermore the
tooltip appears as a transparent black box with rounded corners.
What's going on here? Are their two different tooltip mechanisms with different capabilities?
If I remove the code lines creating/displaying buffer dummy
I
never see the tooltip with the image (the first one); I see only the tooltip
with the text xxx
(the second one).
Edit: Here are screenshots of the two different tooltips.
xxx
after clicking in a window or frame. I'm using Emacs 26.3 on MS Windows.dummy
? What does that have to do with your question? The overlay is not even in that buffer, etc. If it's irrelevant then please consider removing it. If it's relevant then maybe explain how so, etc.emacs -Q foo.el
andC-x C-e
, no more. I do not evaluate any other code than the one I posted.