diff --git a/doom-modeline.el b/doom-modeline.el index f534cba..13466a0 100644 --- a/doom-modeline.el +++ b/doom-modeline.el @@ -544,7 +544,10 @@ If DEFAULT is non-nil, set the default mode-line for all buffers." (add-hook 'find-file-hook #'doom-modeline-update-env) (with-no-warnings (if (boundp 'after-focus-change-function) - (add-function :after after-focus-change-function #'doom-modeline-update-env) + (add-function :after after-focus-change-function + (lambda () + (if (frame-focus-state) + (doom-modeline-update-env)))) (add-hook 'focus-in-hook #'doom-modeline-update-env))) (defun doom-modeline-update-env () "Update environment info on mode-line."