GNU bug report logs - #40047
Images in tooltip-mode tooltips broken on Linux (with x-gtk-use-system-tooltips=t) and OSX

Previous Next

Package: emacs;

Reported by: Dustin Lacewell <dlacewell <at> gmail.com>

Date: Thu, 12 Mar 2020 22:12:01 UTC

Severity: normal

Found in version 26.2

To reply to this bug, email your comments to 40047 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#40047; Package emacs. (Thu, 12 Mar 2020 22:12:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dustin Lacewell <dlacewell <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 12 Mar 2020 22:12:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Dustin Lacewell <dlacewell <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.2; Images in tooltip-mode tooltips broken on Linux and OSX
Date: Thu, 12 Mar 2020 16:54:26 -0500
[Message part 1 (text/plain, inline)]
--text follows this line--

It appears that images in tooltip-mode tooltips is currently broken on
most platforms besides windows. The following snippet should provide an
example:

(defun my-download-as-string (url)
  "Download file from URL and return it as string."
  (let ((image-buf (url-retrieve-synchronously url)))
    (when image-buf
      (with-current-buffer image-buf
        (goto-char (point-min))
        (when (looking-at "HTTP/")
          (delete-region (point-min)
                         (progn (re-search-forward "\n[\n]+")
                                (point))))
        (buffer-substring-no-properties (point-min) (point-max))))))

(defun my-download-image (url)
  "Download URL as image."
  (create-image (my-download-as-string url) (image-type-from-file-name url)
t))

(with-current-buffer (get-buffer-create "*TooltipTest*")
  (tooltip-mode)
  (insert
   (propertize "Facepalm" 'help-echo
               (propertize " " 'display
                           (my-download-image "
https://upload.wikimedia.org/wikipedia/commons/thumb/3/3b/Paris_Tuileries_Garden_Facepalm_statue.jpg/300px-Paris_Tuileries_Garden_Facepalm_statue.jpg
"))))
  (display-buffer (current-buffer)))

Just `eval-buffer` then hover your mouse over `Facepalm` in the new
buffer.

Emacs versions 26.2 26.3 and 28.0.50 were tested on NixOS, Ubuntu, OSX
and Windows.

On Windows a tooltip displays an image. On Linux (NixOS, Ubuntu) and OSX
only a small empty tooltip is presented.

One package I was able to identify that uses this behavior is Dired+

This feature is also useful in general to maintain the readability of
org-mode documents for example.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40047; Package emacs. (Fri, 13 Mar 2020 08:19:01 GMT) Full text and rfc822 format available.

Message #8 received at 40047 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dustin Lacewell <dlacewell <at> gmail.com>
Cc: 40047 <at> debbugs.gnu.org
Subject: Re: bug#40047: 26.2;
 Images in tooltip-mode tooltips broken on Linux and OSX
Date: Fri, 13 Mar 2020 10:18:06 +0200
> From: Dustin Lacewell <dlacewell <at> gmail.com>
> Date: Thu, 12 Mar 2020 16:54:26 -0500
> 
> Just `eval-buffer` then hover your mouse over `Facepalm` in the new
> buffer.
> 
> Emacs versions 26.2 26.3 and 28.0.50 were tested on NixOS, Ubuntu, OSX
> and Windows.
> 
> On Windows a tooltip displays an image. On Linux (NixOS, Ubuntu) and OSX
> only a small empty tooltip is presented.

If, in the GNU/Linux build, you set x-gtk-use-system-tooltips to nil,
does the problem go away?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40047; Package emacs. (Fri, 13 Mar 2020 12:12:02 GMT) Full text and rfc822 format available.

Message #11 received at 40047 <at> debbugs.gnu.org (full text, mbox):

From: Stephen Berman <stephen.berman <at> gmx.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 40047 <at> debbugs.gnu.org, Dustin Lacewell <dlacewell <at> gmail.com>
Subject: Re: bug#40047: 26.2; Images in tooltip-mode tooltips broken on
 Linux and OSX
Date: Fri, 13 Mar 2020 13:11:31 +0100
On Fri, 13 Mar 2020 10:18:06 +0200 Eli Zaretskii <eliz <at> gnu.org> wrote:

>> From: Dustin Lacewell <dlacewell <at> gmail.com>
>> Date: Thu, 12 Mar 2020 16:54:26 -0500
>>
>> Just `eval-buffer` then hover your mouse over `Facepalm` in the new
>> buffer.
>>
>> Emacs versions 26.2 26.3 and 28.0.50 were tested on NixOS, Ubuntu, OSX
>> and Windows.
>>
>> On Windows a tooltip displays an image. On Linux (NixOS, Ubuntu) and OSX
>> only a small empty tooltip is presented.
>
> If, in the GNU/Linux build, you set x-gtk-use-system-tooltips to nil,
> does the problem go away?

It does for me.  That is, I'm running GNU/Linux and with
x-gtk-use-system-tooltips set to t, I don't see the image, but with it
set to nil, I do.

Steve Berman




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40047; Package emacs. (Fri, 13 Mar 2020 14:26:02 GMT) Full text and rfc822 format available.

Message #14 received at 40047 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stephen Berman <stephen.berman <at> gmx.net>
Cc: 40047 <at> debbugs.gnu.org, dlacewell <at> gmail.com
Subject: Re: bug#40047: 26.2; Images in tooltip-mode tooltips broken on
 Linux and OSX
Date: Fri, 13 Mar 2020 16:24:53 +0200
> From: Stephen Berman <stephen.berman <at> gmx.net>
> Cc: Dustin Lacewell <dlacewell <at> gmail.com>,  40047 <at> debbugs.gnu.org
> Date: Fri, 13 Mar 2020 13:11:31 +0100
> 
> > If, in the GNU/Linux build, you set x-gtk-use-system-tooltips to nil,
> > does the problem go away?
> 
> It does for me.  That is, I'm running GNU/Linux and with
> x-gtk-use-system-tooltips set to t, I don't see the image, but with it
> set to nil, I do.

Thanks for testing.  So I guess the problem is that we fail to
instruct the native tooltips to display the image or use the correct
dimensions, for some reason, and the problem doesn't exist on Windows
because we always use our own code for tooltips there.

Patches to fix the native case are welcome.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40047; Package emacs. (Fri, 13 Mar 2020 15:01:01 GMT) Full text and rfc822 format available.

Message #17 received at 40047 <at> debbugs.gnu.org (full text, mbox):

From: Dustin Lacewell <dlacewell <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 40047 <at> debbugs.gnu.org, Stephen Berman <stephen.berman <at> gmx.net>
Subject: Re: bug#40047: 26.2; Images in tooltip-mode tooltips broken on Linux
 and OSX
Date: Fri, 13 Mar 2020 10:00:00 -0500
[Message part 1 (text/plain, inline)]
(Sorry if I am replying incorrectly by replying to all...)

> > If, in the GNU/Linux build, you set x-gtk-use-system-tooltips to nil,
> > does the problem go away?
>
> It does for me.  That is, I'm running GNU/Linux and with
> x-gtk-use-system-tooltips set to t, I don't see the image, but with it
> set to nil, I do.

I can confirm this as well!

On Fri, Mar 13, 2020 at 9:25 AM Eli Zaretskii <eliz <at> gnu.org> wrote:

> > From: Stephen Berman <stephen.berman <at> gmx.net>
> > Cc: Dustin Lacewell <dlacewell <at> gmail.com>,  40047 <at> debbugs.gnu.org
> > Date: Fri, 13 Mar 2020 13:11:31 +0100
> >
> > > If, in the GNU/Linux build, you set x-gtk-use-system-tooltips to nil,
> > > does the problem go away?
> >
> > It does for me.  That is, I'm running GNU/Linux and with
> > x-gtk-use-system-tooltips set to t, I don't see the image, but with it
> > set to nil, I do.
>
> Thanks for testing.  So I guess the problem is that we fail to
> instruct the native tooltips to display the image or use the correct
> dimensions, for some reason, and the problem doesn't exist on Windows
> because we always use our own code for tooltips there.
>
> Patches to fix the native case are welcome.
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40047; Package emacs. (Fri, 13 Mar 2020 15:18:01 GMT) Full text and rfc822 format available.

Message #20 received at 40047 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Dustin Lacewell <dlacewell <at> gmail.com>
Cc: 40047 <at> debbugs.gnu.org
Subject: Re: bug#40047: 26.2; Images in tooltip-mode tooltips broken on Linux
 and OSX
Date: Fri, 13 Mar 2020 16:17:25 +0100 (CET)
On Thu, Mar 12, 2020 at 04:54:26PM -0500, Dustin Lacewell wrote:
> --text follows this line--
> 
> It appears that images in tooltip-mode tooltips is currently broken on
> most platforms besides windows. The following snippet should provide an
> example:
<snip>
> On Windows a tooltip displays an image. On Linux (NixOS, Ubuntu) and OSX
> only a small empty tooltip is presented.

On macOS the tooltips are extremely basic and don’t support anything
other than a few colour options and possibly a change of font.
-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40047; Package emacs. (Fri, 13 Mar 2020 15:58:02 GMT) Full text and rfc822 format available.

Message #23 received at 40047 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alan Third <alan <at> idiocy.org>
Cc: 40047 <at> debbugs.gnu.org, alan <at> idiocy.org, dlacewell <at> gmail.com
Subject: Re: bug#40047: 26.2;
 Images in tooltip-mode tooltips broken on Linux and OSX
Date: Fri, 13 Mar 2020 17:57:30 +0200
> Date: Fri, 13 Mar 2020 16:17:25 +0100 (CET)
> From: Alan Third <alan <at> idiocy.org>
> Cc: 40047 <at> debbugs.gnu.org
> 
> On macOS the tooltips are extremely basic and don’t support anything
> other than a few colour options and possibly a change of font.

Can Emacs on macOS use its own tooltip code?  If so, perhaps we should
make that the default on macOS?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40047; Package emacs. (Fri, 13 Mar 2020 23:18:01 GMT) Full text and rfc822 format available.

Message #26 received at 40047 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 40047 <at> debbugs.gnu.org, dlacewell <at> gmail.com
Subject: Re: bug#40047: 26.2; Images in tooltip-mode tooltips broken on Linux
 and OSX
Date: Sat, 14 Mar 2020 00:17:25 +0100 (CET)
On Fri, Mar 13, 2020 at 05:57:30PM +0200, Eli Zaretskii wrote:
> > Date: Fri, 13 Mar 2020 16:17:25 +0100 (CET)
> > From: Alan Third <alan <at> idiocy.org>
> > Cc: 40047 <at> debbugs.gnu.org
> > 
> > On macOS the tooltips are extremely basic and don’t support anything
> > other than a few colour options and possibly a change of font.
> 
> Can Emacs on macOS use its own tooltip code?  If so, perhaps we should
> make that the default on macOS?

You mean the basic toolkit tooltips? It should be able to. I get the
impression custom tooltips were originally only implemented so they
could have a yellow background like on other terms.
-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40047; Package emacs. (Sat, 14 Mar 2020 08:13:02 GMT) Full text and rfc822 format available.

Message #29 received at 40047 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alan Third <alan <at> idiocy.org>
Cc: 40047 <at> debbugs.gnu.org, dlacewell <at> gmail.com
Subject: Re: bug#40047: 26.2; Images in tooltip-mode tooltips broken on Linux
 and OSX
Date: Sat, 14 Mar 2020 10:12:43 +0200
> Date: Sat, 14 Mar 2020 00:17:25 +0100 (CET)
> From: Alan Third <alan <at> idiocy.org>
> Cc: 40047 <at> debbugs.gnu.org, dlacewell <at> gmail.com
> 
> On Fri, Mar 13, 2020 at 05:57:30PM +0200, Eli Zaretskii wrote:
> > > Date: Fri, 13 Mar 2020 16:17:25 +0100 (CET)
> > > From: Alan Third <alan <at> idiocy.org>
> > > Cc: 40047 <at> debbugs.gnu.org
> > > 
> > > On macOS the tooltips are extremely basic and don’t support anything
> > > other than a few colour options and possibly a change of font.
> > 
> > Can Emacs on macOS use its own tooltip code?  If so, perhaps we should
> > make that the default on macOS?
> 
> You mean the basic toolkit tooltips?

Not sure what you mean by that.  I meant the tooltips w implement in
Emacs's own code, whereby a tooltip is a special kind of frame.

> It should be able to. I get the impression custom tooltips were
> originally only implemented so they could have a yellow background
> like on other terms.

The tooltips implemented in Emacs's own code also have a yellow
background.  And it's a frame, so the faces we use there can be
customized, see tooltip-frame-parameters.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40047; Package emacs. (Sat, 14 Mar 2020 08:50:01 GMT) Full text and rfc822 format available.

Message #32 received at 40047 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Eli Zaretskii <eliz <at> gnu.org>, Stephen Berman <stephen.berman <at> gmx.net>
Cc: 40047 <at> debbugs.gnu.org, dlacewell <at> gmail.com
Subject: Re: bug#40047: 26.2; Images in tooltip-mode tooltips broken on Linux
 and OSX
Date: Sat, 14 Mar 2020 09:49:24 +0100
> Thanks for testing.  So I guess the problem is that we fail to
> instruct the native tooltips to display the image or use the correct
> dimensions, for some reason, and the problem doesn't exist on Windows
> because we always use our own code for tooltips there.
>
> Patches to fix the native case are welcome.

The native case is neither broken nor can it be fixed.  Tooltips like
those provided by GTK, Windows or many desktops are supposed to provide
a uniform look across all sorts of applications that use them so that
the user can easily recognize tooltips as what they are.  That's why they
usually have customizable backgrounds, fonts and borders.  Applications
are not supposed to meddle with them.

martin




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40047; Package emacs. (Sat, 14 Mar 2020 10:12:01 GMT) Full text and rfc822 format available.

Message #35 received at 40047 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 40047 <at> debbugs.gnu.org, stephen.berman <at> gmx.net, dlacewell <at> gmail.com
Subject: Re: bug#40047: 26.2; Images in tooltip-mode tooltips broken on Linux
 and OSX
Date: Sat, 14 Mar 2020 12:11:48 +0200
> Cc: 40047 <at> debbugs.gnu.org, dlacewell <at> gmail.com
> From: martin rudalics <rudalics <at> gmx.at>
> Date: Sat, 14 Mar 2020 09:49:24 +0100
> 
> The native case is neither broken nor can it be fixed.  Tooltips like
> those provided by GTK, Windows or many desktops are supposed to provide
> a uniform look across all sorts of applications that use them so that
> the user can easily recognize tooltips as what they are.  That's why they
> usually have customizable backgrounds, fonts and borders.  Applications
> are not supposed to meddle with them.

So you are saying the native tooltips cannot usefully display images?
I'd be surprised, but if that is indeed so, we should at least
document that, so users who do want images in tooltips could switch to
our tooltips.




Changed bug title to 'Images in tooltip-mode tooltips broken on Linux (with x-gtk-use-system-tooltips=t) and OSX' from '26.2; Images in tooltip-mode tooltips broken on Linux and OSX' Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 18 Mar 2020 12:38:01 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 278 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.