Subject: bug#31020: 27.0; Please provide a way to know about menu-bar wrapping

From: martin rudalics <[email-masked]>
Date: Wed, 04 Apr 2018 09:49:48 +0200

> Yes.  But you'll perhaps tell me to do things another
 > way (e.g., pixelwise). ;-)

I'm afraid that both approaches might face similar problems.

 > If my code could know how many _effective_ (i.e.,
 > visual) `menu-bar-lines' were currently present then
 > it would just DTRT.

Why don't you try to divide the value of

(cddr (assq 'menu-bar-size (frame-geometry)))

by 'frame-char-height'?  IIUC the character height used by a toolkit
for drawing the menu bar is of no use to you anyway.

But to fit a frame you (and the pixelwise fitter as well) would have
to be able to tell _in advance_ whether the menu bar will wrap.  And
this is impossible since at least on a proprietary system like Windows
you would have to know which algorithm it uses for aligning menu bar
elements.  Or am I missing something?

martin