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

From: Po Lu <[email-masked]>
Date: Sat, 16 Jul 2022 11:14:57 +0800

Eli Zaretskii <[email-masked]> writes:

> 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.

That leads to blank tooltips inside popup menus.

Here is the vital code in this case:

  clear_glyph_matrix (w->desired_matrix);
  clear_glyph_matrix (w->current_matrix);
  SET_TEXT_POS (pos, BEGV, BEGV_BYTE);
  try_window (window, pos, TRY_WINDOW_IGNORE_FONTS_CHANGE);
  [...]
  w->must_be_updated_p = true;
  update_single_window (w);
  flush_frame (tip_f);

Otherwise, the contents of the tooltip will not be visible by the time
the tooltip is displayed, and will not be generated, as redisplay cannot
happen inside a popup menu.