fix: menu-bar not disabled in some instances

It seems unsetting menu-bar-mode is enough on *some* builds of Emacs,
but not all. Best we cover all the bases.

Amend: 4a253757cb
Fix: #6790
This commit is contained in:
Henrik Lissner 2022-09-16 18:27:04 +02:00
parent 6bd8cbf903
commit 58c0de6841
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -102,11 +102,14 @@
;; HACK: I intentionally avoid calling `menu-bar-mode', `tool-bar-mode', and ;; HACK: I intentionally avoid calling `menu-bar-mode', `tool-bar-mode', and
;; `scroll-bar-mode' because they do extra work to manipulate frame variables ;; `scroll-bar-mode' because they do extra work to manipulate frame variables
;; that isn't necessary this early in the startup process. ;; that isn't necessary this early in the startup process.
(setq scroll-bar-mode nil (push '(menu-bar-lines . 0) default-frame-alist)
tool-bar-mode nil (push '(tool-bar-lines . 0) default-frame-alist)
menu-bar-mode nil)
;; Setting `scroll-bar-mode' isn't enough to disable them, so:
(push '(vertical-scroll-bars) default-frame-alist) (push '(vertical-scroll-bars) default-frame-alist)
;; And set these to nil so users don't have to toggle the modes twice to
;; reactivate them.
(setq menu-bar-mode nil
tool-bar-mode nil
scroll-bar-mode nil)
;; FIX: On MacOS, disabling the menu bar makes MacOS treat Emacs as a ;; FIX: On MacOS, disabling the menu bar makes MacOS treat Emacs as a
;; non-application window -- which means it doesn't automatically capture ;; non-application window -- which means it doesn't automatically capture
;; focus when it is started, among other things, so enable the menu-bar for ;; focus when it is started, among other things, so enable the menu-bar for