Subject: bug#60510: 30.0.50; [PATCH] Do not put pointer on first menu item in no-toolkit build

From: Eli Zaretskii <[email-masked]>
Date: Tue, 03 Jan 2023 15:30:15 +0200

> From: Manuel Giraud <[email-masked]>
> Cc: Manuel Giraud <[email-masked]>,  [email-masked]
> Date: Tue, 03 Jan 2023 14:09:26 +0100
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> [...]
> 
> > This is age-old behavior, common also with TTY menus.  We should at
> > least change all of them.  And frankly, I'm not sure we should change
> > it, after so many years.  Someone might depend on this behavior.
> 
> Yes, as this is part of oldXMenu, I suspected that.
> 
> So more generally, I kind of like the no toolkit backend but I want to
> be able to modify it (my pipe dream being able to use emacs face
> machinery to write to those menus).  What would be my best bet here?
> Rewrite a plain X11 backend from scratch?

Sorry, I don't understand: AFAIK oldXMenu is not used by any build
other than the no-toolkit build.  So why cannot you modify it?

What I wrote above doesn't prevent anyone from making changes, I was
just thinking aloud whether we should make this particular change.

To answer your more general question: to use faces, you must use the
Emacs display code to generate the glyphs and deliver them to the
glass.  Basically, you must abandon oldXMenu and re-implement the
menus using the Emacs display code.  The main problem here is that
menus are drop-down, i.e., they overlap stuff already on the glass,
and Emacs currently doesn't allow that.  (TTY menus pull that trick,
but they can only get away because all the characters have the same
dimensions on TTY frames, something that is not true for X display,
assuming you want to use font parts of the faces, not just their
colors.)  So you'd need some other trick here, maybe using child
frames?