GNU bug report logs - #72986
Disabling menu-bar-mode changes size of new frames

Previous Next

Package: emacs;

Reported by: Reuben Thomas <rrt <at> sc3d.org>

Date: Mon, 2 Sep 2024 18:52:01 UTC

Severity: normal

Full log


Message #134 received at 72986 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Reuben Thomas <rrt <at> sc3d.org>
Cc: Po Lu <luangruo <at> yahoo.com>, Eli Zaretskii <eliz <at> gnu.org>,
 72986 <at> debbugs.gnu.org
Subject: Re: bug#72986: Disabling menu-bar-mode changes size of new frames
Date: Sat, 14 Sep 2024 16:43:29 +0200
[Message part 1 (text/plain, inline)]
> Here is the frame size history:

Thanks.

> x_create_frame_2 (0), MS=160x175
> xg_frame_set_char_size, invisible, PS=1328x1260, XS=1328x1260, DS=1328x1260
> xg_frame_set_char_size (5), MS=32x70 IH IV
> x_make_frame_visible
> MapNotify, not hidden & not iconified, PS=1328x1260, DS=1328x1260
> ConfigureNotify, PS=1328x1260, XS=400x340, DS=1328x1260

Here we go again with the small size, reject it and ask for the previous
size ...

> xg_frame_resized, rejected, PS=1328x1260, XS=400x340, DS=1328x1260
> tool-bar-lines (2), MS=160x175
> xg_frame_set_char_size, visible, PS=1328x1260, XS=1328x1260, DS=1328x1260
> ConfigureNotify, PS=1328x1260, XS=2560x1346, DS=1328x1260

... but now all of a sudden we should handle a frame size about twice as
large which we reject again ...

> xg_frame_resized, rejected, PS=1328x1260, XS=2560x1346, DS=1328x1260
> ConfigureNotify, PS=1328x1260, XS=2560x1326, DS=1328x1260
> xg_frame_resized, rejected, PS=1328x1260, XS=2560x1326, DS=1328x1260
> set_window_configuration (4), MS=160x175 IH IV
>
> Note that something quite different happens when I open the second frame:
> it ends up full screen, but the Emacs window only occupies the same space
> as the initial window (roughly half the screen wide, and a little shorter
> than the screen).

... and never fill accordingly because we don't like it.  This was a bad
idea.  The second call of gtk_window_resize simply has to get the same
dimensions as the first one as in the first version of this patch.

Just that the "first version" of this patch had another problem: The
sizes we ask for in gtk_window_resize via outer_height and outer_width
include tool and menu bars.  The sizes reported by ConfigureNotify are
those of the native rectangle only.  I hopefully fixed that now.  Please
try again and tell me the histories you get here for the initial frame
and the second frame both with and without the menu bar by evaluating
(frame--size-history).

> frame-char-width: 16
> frame-char-height: 35

Times twice gets us the MS=32x70 above.

Next I'd like to know what you see with

(let ((frame (make-frame '((visibility . nil)))))
  (make-frame-visible frame))

and

(let ((frame (make-frame '((visibility . nil) (menu-bar-lines . 0)))))
  (make-frame-visible frame))

both with an unpatched Emacs and a patched one.  Here the second frame
appears exactly where the first one is, so we would have to care about
the placement ourselves.

I only want to know whether this "visibly" improves the behavior you
observe (no need to look at the history of these frames).  The idea is
that we could make creation of the second frame smoother so that you
don't see its initial size.

martin
[gtkutil-reject.diff (text/x-patch, attachment)]

This bug report was last modified 182 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.