Subject: bug#76210: 31.0.50; menu-bar-mode unexpectedly shrinks frame substantially

From: martin rudalics <[email-masked]>
Date: Wed, 12 Feb 2025 11:02:59 +0100

>> To reproduce this issue, please invoke Emacs with:
 >>
 >>      $ emacs -Q --eval "(while t (menu-bar-mode (if menu-bar-mode 0 1)) (redisplay))"
 >>
 >> Within a few seconds of running this, I unexpectedly see the frame
 >> getting smaller and smaller.
 >>
 >> With earlier Emacs versions, the frame unexpectedly becomes
 >> substantially larger within a few minutes of running it.
 >
 > I cannot reproduce this on MS-Windows.
 >
 > Martin, any comments, thoughts, or suggestions?

I cannot reproduce it here with

In GNU Emacs 31.0.50 (build 2, x86_64-pc-linux-gnu, X toolkit, cairo
  version 1.16.0, Xaw3d scroll bars) of 2025-02-12 built on restno
Repository revision: 55ffbeaab1da66abee8a84f79c2cebd2c61f336f
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101007
System Description: Debian GNU/Linux 12 (bookworm)

Configured using:
  'configure --with-gif=ifavailable --with-tiff=ifavailable
  --with-gnutls=no --without-pop --enable-gcc-warnings=warn-only
  --with-x-toolkit=lucid --enable-checking=yes
  --enable-check-lisp-object-type=yes 'CFLAGS=-O0 -g3 -no-pie
  -Wno-missing-braces''

Configured features:
CAIRO DBUS FREETYPE GIF GLIB GSETTINGS HARFBUZZ JPEG LIBSELINUX MODULES
NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF
TOOLKIT_SCROLL_BARS WEBP X11 XAW3D XDBE XIM XINERAMA XINPUT2 XPM XRANDR
LUCID ZLIB

The frame keeps shrinking and expanding by one line as expected.

What happens when you evaluate

(setopt frame-inhibit-implied-resize '(tab-bar-lines menu-bar-lines))

before triggering that loop?  If you want to run it from the command line,
use

  --eval "(progn (setopt frame-inhibit-implied-resize '(tab-bar-lines menu-bar-lines)) (while t (menu-bar-mode (if menu-bar-mode 0 1)) (redisplay)))"

Thanks, martin