Subject: Re: bug#72986: Disabling menu-bar-mode changes size of new frames

From: martin rudalics <[email-masked]>
Date: Fri, 15 Nov 2024 18:20:48 +0100

> Just to check I've understood what you want here, I did a first run with
 > the latest gtkutil-frame-2.diff applied, and with breakpoints on those two
 > lines, of simply "emacs -Q", and I get, for just opening the initial
 > window, 4 hits on each breakpoint.
 >
 > The first hit is w = 0, h = 0.
 >
 > The other three are w = 64, h = 167.

OK.

 > I wasn't exactly sure what you meant by a "good" or "bad" scenario; but I
 > guess you meant "good" == "with patch applied", and "bad" == "without patch
 > applied"?

With "good" scenario I meant one where you don't see any shrinking.  A
"bad" scenario is one where you see it.  Sorry for being unclear.

Please apply the attached diff to an unpatched Emacs and tell me whether
the frame sizes for a bad scenario are in any way different from those
that you see for the same bad scenario in an unpatched Emacs.  Here the
patch has no effect.

Thanks, martin

diff --git a/src/emacsgtkfixed.c b/src/emacsgtkfixed.c
index 3941960b3ba..a7eddb31150 100644
--- a/src/emacsgtkfixed.c
+++ b/src/emacsgtkfixed.c
@@ -105,7 +105,7 @@ emacs_fixed_get_preferred_width (GtkWidget *widget,
 #else
   int w = priv->f->output_data.x->size_hints.min_width;
   if (minimum) *minimum = w;
-  if (natural) *natural = w;
+  if (natural) *natural = 800;
 #endif
 }
 
@@ -123,7 +123,7 @@ emacs_fixed_get_preferred_height (GtkWidget *widget,
 #else
   int h = priv->f->output_data.x->size_hints.min_height;
   if (minimum) *minimum = h;
-  if (natural) *natural = h;
+  if (natural) *natural = 600;
 #endif
 }