From 3583e1f2e0249cddc2d8709238230c181b4bb3ef Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 21 Dec 2019 14:56:56 -0500 Subject: [PATCH] Re-enable menu-bar-lines for GUI frames on MacOS #2156 --- core/core-ui.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/core-ui.el b/core/core-ui.el index 795f45c25..2918a1f88 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -300,10 +300,14 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original (require 'ns-auto-titlebar nil t) (ns-auto-titlebar-mode +1)) - (add-hook! 'after-make-frame-functions + ;; 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. We enable menu-bar-lines + ;; there, but we still want it disabled in terminal frames because there + ;; it activates an ugly menu bar. + (add-hook! '(window-setup-hook after-make-frame-functions) (defun doom-init-menu-bar-in-gui-frames-h (frame) - "On MacOS, the menu bar isn't part of the frame. Disabling it makes MacOS -treat Emacs as a non-application window." + "Re-enable menu-bar-lines in GUI frames." (when (display-graphic-p frame) (set-frame-parameter frame 'menu-bar-lines 1)))))