From: Roshan Shariff <roshan.shariff@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Po Lu <luangruo@yahoo.com>, 67654@debbugs.gnu.org
Subject: bug#67654: 29.1; Hiding menu bar makes new frames very small
Date: Mon, 11 Dec 2023 00:13:04 -0700 [thread overview]
Message-ID: <CAG8iPGxLEkM2eQGrKAjh_ShR5N6K=8o8Hk+M+GeWLR6-cWxtNQ@mail.gmail.com> (raw)
In-Reply-To: <CAG8iPGyVMM8eLONM2auM_xjUw_upG_zkss8cDe6qMaRdgbUYnQ@mail.gmail.com>
I tried a git bisect only to find that commits as far back as ~2015
exhibit the bug; I wasn't able to compile older versions on my system
because of segfaults during compilation. So it seems plausible that
the GTK3 build of Emacs has always had this issue.
While coming up with a workaround (see below) I noticed something odd.
I added a hook to after-make-frame-functions that prints out the
frame-{char,native,text,outer}-{width,height} of the newly created
frame. I found that immediately after the frame is created, these
values are fine. But when printing them out after a brief sleep-for,
or using run-with-timer, the values actually match the size of the
tiny frame. So it seems that Emacs thinks the frame has the correct
size on creation, but learns of its actual size a little bit later.
The following workaround needs the run-with-timer (and the duration
needs to be long enough):
(add-hook 'after-make-frame-functions
(defun +resize-after-make-frame (frame)
;; HACK Resize new frames shortly after creation. Works around
;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=67654
(when-let ((width (alist-get 'width default-frame-alist))
(height (alist-get 'height default-frame-alist)))
(run-with-timer (/ 1.0 60) nil #'set-frame-size frame width height))))
I figure there's little chance of finding the root cause, but
hopefully the workaround will help people who come across this.
next prev parent reply other threads:[~2023-12-11 7:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAG8iPGxmb2f-1PH6HKEbLzchr+DRE2DAiCWG6YKmAOX6+ORdGA@mail.gmail.com>
2023-12-06 8:26 ` bug#67654: 29.1; Hiding menu bar makes new frames very small Roshan Shariff
2023-12-06 12:33 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-06 12:39 ` Eli Zaretskii
2023-12-06 16:48 ` Roshan Shariff
2023-12-11 7:13 ` Roshan Shariff [this message]
2023-12-11 7:37 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-11 12:14 ` Eli Zaretskii
2023-12-11 12:38 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-19 1:57 ` John Avery
2023-12-06 7:52 Roshan Shariff
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAG8iPGxLEkM2eQGrKAjh_ShR5N6K=8o8Hk+M+GeWLR6-cWxtNQ@mail.gmail.com' \
--to=roshan.shariff@gmail.com \
--cc=67654@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=luangruo@yahoo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.