mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
fix: over-aggressive doom--run-switch-frame-hooks-fn
Due to a typo in the hook's self-removal, causing this function to
trigger many times per second. It isn't doing much thanks to the
debouncing, but was still legitimately triggering doom-switch-frame-hook
every ~2 seconds despite no change in frame focus.
Also removes the ineffectual inhibit-redisplay let-bind.
Amend: 653b465c74
This commit is contained in:
@ -121,7 +121,7 @@ non-interactive code, or the user accidentally (and rapidly) un-and-refocusing
|
||||
the frame through some other means.")
|
||||
|
||||
(defun doom--run-switch-frame-hooks-fn (_)
|
||||
(remove-hook 'pre-redisplay-functions #'doom--run-switch-frame-hooks)
|
||||
(remove-hook 'pre-redisplay-functions #'doom--run-switch-frame-hooks-fn)
|
||||
(let ((gc-cons-threshold most-positive-fixnum))
|
||||
(dolist (fr (visible-frame-list))
|
||||
(let ((state (frame-focus-state fr)))
|
||||
@ -139,12 +139,11 @@ the frame through some other means.")
|
||||
(let (last-focus-state)
|
||||
(defun doom-run-switch-frame-hooks-fn ()
|
||||
"Trigger `doom-switch-frame-hook' once per frame focus change."
|
||||
(let ((inhibit-redisplay t))
|
||||
(or (equal last-focus-state
|
||||
(setq last-focus-state
|
||||
(mapcar #'frame-focus-state (frame-list))))
|
||||
;; Defer until next redisplay
|
||||
(add-hook 'pre-redisplay-functions #'doom--run-switch-frame-hooks-fn)))))
|
||||
(add-hook 'pre-redisplay-functions #'doom--run-switch-frame-hooks-fn))))
|
||||
|
||||
(defun doom-protect-fallback-buffer-h ()
|
||||
"Don't kill the scratch buffer. Meant for `kill-buffer-query-functions'."
|
||||
|
Reference in New Issue
Block a user