Reduce screen flicker when creating a new frame
...by only reloading the theme if the new frame is of a different type from the last (tty and GUI frames).
This commit is contained in:
parent
cdbd677423
commit
cfe2fe87d9
1 changed files with 5 additions and 1 deletions
|
@ -417,6 +417,8 @@ character that looks like a space that `whitespace-mode' won't affect.")
|
||||||
;; Theme & font
|
;; Theme & font
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
(defvar doom-last-frame-type window-system)
|
||||||
|
|
||||||
(defun doom|init-theme ()
|
(defun doom|init-theme ()
|
||||||
"Set the theme and load the font, in that order."
|
"Set the theme and load the font, in that order."
|
||||||
(when doom-theme
|
(when doom-theme
|
||||||
|
@ -459,7 +461,9 @@ character that looks like a space that `whitespace-mode' won't affect.")
|
||||||
;; frames, however. There's always `doom//reload-theme' if you need it!
|
;; frames, however. There's always `doom//reload-theme' if you need it!
|
||||||
(defun doom|init-theme-in-frame (frame)
|
(defun doom|init-theme-in-frame (frame)
|
||||||
"Reloads the theme in new daemon or tty frames."
|
"Reloads the theme in new daemon or tty frames."
|
||||||
(when (or (daemonp) (not (display-graphic-p)))
|
(when (and (not (eq doom-last-frame-type window-system))
|
||||||
|
(or (daemonp) (not (display-graphic-p))))
|
||||||
|
(setq doom-last-frame-type window-system)
|
||||||
(with-selected-frame frame
|
(with-selected-frame frame
|
||||||
(doom|init-theme))))
|
(doom|init-theme))))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue