From 240493ae9235d2b1b2ffc1d98cd829b7d2bbb236 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 11 Sep 2024 06:20:01 -0400 Subject: [PATCH] fix: face-* calls crashing new emacsclient frames Those `face-*` calls sometimes returned nil, causing new frames spawned from emacsclient to quietly crash sometimes. By instead relying on `frame-inherited-parameters` we achieve the same but more stable result. Amend: 9753bfb775d0 --- lisp/doom-ui.el | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lisp/doom-ui.el b/lisp/doom-ui.el index 09cd845d2..a5859ad59 100644 --- a/lisp/doom-ui.el +++ b/lisp/doom-ui.el @@ -284,6 +284,14 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original (setq split-width-threshold 160 split-height-threshold nil) +;; Fix incorrect fg/bg in new frames created after the initial frame +;; (which are reroneously displayed as black). +(setq frame-inherited-parameters '(background-color + foreground-color + cursor-color + border-color + mouse-color)) + ;; ;;; Minibuffer @@ -589,11 +597,7 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original (setq doom-theme theme) (put 'doom-theme 'previous-themes (or last-themes 'none)) ;; DEPRECATED Hook into `enable-theme-functions' when we target 29 - (doom-run-hooks 'doom-load-theme-hook) - (when-let* ((fg (face-foreground 'default nil t)) - (bg (face-background 'default nil t))) - (setf (alist-get 'foreground-color default-frame-alist) fg - (alist-get 'background-color default-frame-alist) bg))))))) + (doom-run-hooks 'doom-load-theme-hook)))))) ;;