Subject: Re: [External] : bug#23341: x-show-tip does not respect the value of tooltip-hide-delay, and the default tooltip timeout isn't configurable

From: Po Lu <[email-masked]>
Date: Mon, 02 May 2022 10:50:07 +0800

Drew Adams <[email-masked]> writes:

> Lots of things can happen unpredictably with
> frames, per different window managers.

Not if you use `tooltip-show', I think.

> And invisible frames are used seldom - so
> much so that Emacs has even (misguidedly)
> toyed with the idea of getting rid of their
> support.
>
> But pray, please do elaborate?  What's so
> special about tooltips here?

Tooltips are made transient for the frame they are displayed in.
Compositing managers look at the WM_TRANSIENT_FOR property on tooltip
frames (which are a special kind of frame created without any widgets
that are always override redirect) to determine how to display the
tooltip.  Those frames are also displayed outside the usual redisplay
machinery, and only once, inside `x-show-tip'.

> Please consider documenting it, whatever
> it is - especially the "dangerous" bit.
>
> And if this happens with tooltips then what
> makes you think it's limited to the use of
> `x-show-tip'?  Just what is `x-show-tip'-
> specific?

That cannot happen with `tooltip-show'.

> Some things?  In 'params'?  (PARMS maybe?)  
>
> Any crash is an Emacs bug (in C code).  Needs to
> be fixed, regardless of who's authorized to use
> `x-show-tip'.

So crashing on some kinds of invalid bytecode is an Emacs bug, for that
same reason? 

> If there are problems/gotchas/bugs/mysteries wrt
> PARMS, or anything else your vague response is
> meant to intimate, please fix or document them.

`tool-bar-position' is one example of such a problematic frame
parameter, and there are many others, but I never enumerated all of
them.

Lisp code should _never_ manipulate tooltip frames.  They are special on
the C level in that many assumptions (such as there being a GTK or Xt
widget for each frame), or that the frame has at least one window that
isn't a "pseudo window" do not hold.  This is also why we bend over
backwards to not make tooltip frames visible to Lisp inside frame lists
and probably the display-buffer stuff as well.

> There's no difference in this regard between what
> "core Emacs developers" need (and need to know)
> when using `x-show-tip' and what other Emacs
> developers need (i.e., users who develop 3rd-party
> libraries) need.
>
> Fix it or document it.  That's the proper response
> for something useful that (you think) has problems.

It is documented.  The doc string says:

  This is an internal function; Lisp code should call `tooltip-show'.