Subject: Re: bug#56561: 29.0.50; Infloop in try_window

From: Eli Zaretskii <[email-masked]>
Date: Fri, 15 Jul 2022 18:37:50 +0300

> Cc: [email-masked], [email-masked]
> Date: Fri, 15 Jul 2022 18:27:15 +0300
> From: Eli Zaretskii <[email-masked]>
> 
> > Cc: [email-masked], [email-masked]
> > Date: Fri, 15 Jul 2022 17:24:26 +0300
> > From: Eli Zaretskii <[email-masked]>
> > 
> > > From: Po Lu <[email-masked]>
> > > Cc: [email-masked],  [email-masked]
> > > Date: Fri, 15 Jul 2022 21:54:24 +0800
> > > 
> > > BTW, I have a question about the fix: redisplay cannot run when a
> > > tooltip is displayed as popup menu help-text, so adjust_glyph_matrix and
> > > the subsequent try_window call that is required to generate the display
> > > contents will not be called in time, leading to a blank tooltip.
> > > 
> > > The call could previously never fail, since the tooltip code specifies
> > > TRY_WINDOW_IGNORE_FONTS_CHANGE.
> > > 
> > > Would it be appropriate to call adjust_frame_glyphs and try_window again
> > > if this call to try_window in Fx_show_tip fails?
> > 
> > You mean, adjust_frame_glyphs, right?
> > 
> > We probably should do that
> 
> On second thought, I take this back.  I don't see how we could have a
> blank tooltip.  We call try_window just so we could compute the size
> of the text in it, which then allows us to know the size of the
> tooltip.

On third thought, why do we even call try_window there?  The original
code needed try_window because it then used the glyph matrix it
produces to calculate the size of the tooltip.  But we've dumped that
code, and we nowadays use window-text-pixel-size instead, which
emulates the display internally anyway.  So I think we should simply
delete the call to try_window from x-show-tip, and be done.  At least
on master.