From da6ce8e3f905ec6c2097720625ff96227165486a Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 14 Jun 2018 13:57:03 +0200 Subject: [PATCH] Fix over-aggressive theme reloading `display-graphic-p` returns a boolean (possibly a recent change in Emacs 27), which will never match any window system, causing the theme to be reloaded on every new frame. Also default doom-last-window-system to initial-window-system. --- core/core-ui.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/core-ui.el b/core/core-ui.el index 0b1acb401..4ad92a1a2 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -546,7 +546,8 @@ character that looks like a space that `whitespace-mode' won't affect.") ;; Theme & font ;; -(defvar doom-last-window-system (if (daemonp) 'daemon window-system) +(defvar doom-last-window-system + (if (daemonp) 'daemon initial-window-system) "The `window-system' of the last frame. If this doesn't match the current frame's window-system, the theme will be reloaded.") @@ -588,7 +589,7 @@ frame's window-system, the theme will be reloaded.") (defun doom|init-theme-in-frame (frame) "Reloads the theme in new daemon or tty frames." (when (and (framep frame) - (not (eq doom-last-window-system (display-graphic-p frame)))) + (not (eq doom-last-window-system (framep-on-display frame)))) (with-selected-frame frame (doom|init-theme)) (setq doom-last-window-system (display-graphic-p frame))))