From ede6553959d73710807592d5eb1e21d720ab74c2 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 24 Feb 2017 03:13:23 -0500 Subject: [PATCH] ui/doom-dashboard: add deferred reload for new frames --- modules/ui/doom-dashboard/config.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/ui/doom-dashboard/config.el b/modules/ui/doom-dashboard/config.el index 06d6741f9..881e86e5a 100644 --- a/modules/ui/doom-dashboard/config.el +++ b/modules/ui/doom-dashboard/config.el @@ -42,6 +42,7 @@ (setq doom-fallback-buffer +doom-dashboard-name) (add-hook 'emacs-startup-hook '+doom-dashboard/open) +(add-hook 'after-make-frame-functions '+doom-dashboard-deferred-reload) (add-hook! 'kill-buffer-query-functions (if (not (+doom-dashboard-p)) t @@ -84,6 +85,11 @@ (setq fringe-indicator-alist +doom-dashboard--old-fringe-indicator) (remove-hook 'evil-insert-state-entry-hook 'doom|mode-erase-on-insert t))) +(defun +doom-dashboard-deferred-reload (&rest _) + "Reload the dashboard after a brief pause. This is necessary for new frames, +whose dimensions may not be fully initialized by the time this is run." + (run-with-timer 0.1 nil '+doom-dashboard-reload)) + (defun +doom-dashboard-reload (&optional dir) "Update the DOOM scratch buffer (or create it, if it doesn't exist)." (when (and (not +doom-dashboard-inhibit-refresh)