fix: disable UI elements earlier

Moves this from doom-ui to doom-start, since there is more savings to be
had if this is done early.

Also moves the menu-bar fix for macos out of the :os macos module into
doom-start, because it is a fix (and for a Doom optimization) and not a
feature, so it shouldn't be behind a module.
This commit is contained in:
Henrik Lissner 2022-09-15 19:02:26 +02:00
parent 1be11539e8
commit 41051f4761
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
3 changed files with 28 additions and 29 deletions

View file

@ -29,18 +29,6 @@
(require 'ns-auto-titlebar nil t)
(ns-auto-titlebar-mode +1))
;; HACK: On MacOS, disabling the menu bar makes MacOS treat Emacs as a
;; non-application window -- which means it doesn't automatically capture
;; focus when it is started, among other things, so enable the menu-bar for
;; GUI frames, but keep it disabled in terminal frames because there it
;; activates an ugly, in-frame menu bar.
(add-hook! '(window-setup-hook after-make-frame-functions)
(defun doom-init-menu-bar-in-gui-frames-h (&optional frame)
"Re-enable menu-bar-lines in GUI frames."
(when-let (frame (or frame (selected-frame)))
(when (display-graphic-p frame)
(set-frame-parameter frame 'menu-bar-lines 1)))))
;; Integrate with Keychain
(after! auth-source
(pushnew! auth-sources 'macos-keychain-internet 'macos-keychain-generic))