Subject: bug#57372: no-toolkit menu popups do not respect emacs font configuration

From: Po Lu <[email-masked]>
Date: Wed, 24 Aug 2022 20:11:54 +0800

Eli Zaretskii <[email-masked]> writes:

> Well, "no" is never correct when we deal with software ;-)
>
> But yes, it should be quite a project.  The basic problem here is that
> menus are not displayed by the Emacs display engine, they are
> displayed by a separate code (which we "stole" from X11).
>
> Displaying pop-down menus with our display engine is "tricky", as the
> TTY menus experience amply shows.

Indeed, though it should be easier if each pane is a separate frame.

I've been trying to figure out if it is possible to implement menus as
frames, mostly in Lisp.

The problem is that creating frames is too slow for responsive menus,
and from skimming various pieces of documentation, it seems that there
is no portable way to transfer the grab from the first frame to other
leaf frames as they are created.  The main problems here are Wayland and
macOS, where the APIs required to implement correct menu grabbing
behavior are not exposed by GTK or Cocoa.