On Thu, 5 Sept 2024 at 08:49, martin rudalics <rudalics@gmx.at> wrote:
 > My bisection suggests the problematic commit is
 > 241616831024c9c9fe2b2378b611db0a560b9675

Thanks.  Please try first setting 'frame-inhibit-implied-resize' to t
which should avoid that a frame gets resized when the menu bar is
enabled or disabled

Setting the variable to t does indeed prevent the frame being resized when menu-bar-mode is toggled, but has no effect on the size of the subsequent windows created.

If this does not help, please proceed as follows: Try to undo that
commit (I cite it below)

I checked out git master HEAD (currently df57e44a08f) and reverted commit 241616831024c9c9fe2b2378b611db0a560b9675 on top of that.

and please first run without the commit under
gdb with a breakpoint at the line

       adjust_frame_size (f, -1, -1, 2, 0, Qmenu_bar_lines);

in xg_update_frame_menubar.  Please note all values you see after doing

p req.height

50 (before initial frame opens)
50 (after C-x 5 2, before second frame opens)

And the second frame opens at the expected size, the same size as the first.

Then restore current master and repeat the same steps.  When the values
differ, this should tell us something about what happens.

50 (before initial frame opens)
50 (after C-x 5 2, before second frame opens)

But the second frame opens small.