aboutsummaryrefslogtreecommitdiff
path: root/modules/auto-dim-config.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-26 07:47:03 -0500
committerCraig Jennings <c@cjennings.net>2026-05-26 07:47:03 -0500
commit35b5739e791965c837c2e715076b52d3fee9e156 (patch)
tree3a8ccd8eaf1c8e8bc23cd40d02cdb87563537daa /modules/auto-dim-config.el
parent877a7cbc87abe1df4b5d881f204c593141ca8c88 (diff)
downloaddotemacs-35b5739e791965c837c2e715076b52d3fee9e156.tar.gz
dotemacs-35b5739e791965c837c2e715076b52d3fee9e156.zip
fix(dashboard): exempt the banner buffer from auto-dim
The butterfly banner is a transparent PNG. On this X11 build Emacs composites image alpha against one background color and caches the flat pixmap. So when auto-dim remaps a non-selected dashboard's background to near-black, the cached image keeps its old composite and the transparent edges show as a lighter rectangle. I exempted the *dashboard* buffer from dimming through the fork's never-dim-buffer hook, so its background never shifts. Live alpha compositing would need a pgtk build, which is out because of its fractional-scaling input lag, and every theme-level workaround changes dimming for all buffers. Scoping the exemption to one short-lived buffer is the narrow fix. The trade is no focus cue when the dashboard is shown in a split. I also dropped the :mask heuristic prop from the prior banner commit. The PNG already carries a real alpha channel, so heuristic masking was the wrong tool. Once the background is stable, the native alpha over the theme background reads clean on its own. I added Normal/Boundary/Error tests for the predicate.
Diffstat (limited to 'modules/auto-dim-config.el')
-rw-r--r--modules/auto-dim-config.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/auto-dim-config.el b/modules/auto-dim-config.el
index e538e523..ebda92c2 100644
--- a/modules/auto-dim-config.el
+++ b/modules/auto-dim-config.el
@@ -192,6 +192,19 @@ the fallback that makes vterm repaint after auto-dim changes window state."
(setq cj/auto-dim--last-selected-window (selected-window))
(cj/auto-dim--schedule-vterm-refresh))
+(defun cj/auto-dim--never-dim-dashboard-p (buffer)
+ "Return non-nil when BUFFER is the dashboard, so it stays lit.
+The dashboard banner is a transparent PNG. On this non-pgtk build Emacs
+composites image alpha against one background color at render time and
+caches the flat pixmap; it can't re-blend when dimming remaps the
+background to the near-black `auto-dim-other-buffers' face, so the
+transparent edges show a baked-in rectangle in a dimmed dashboard. Live
+alpha would need a pgtk build, ruled out by its fractional-scaling input
+lag. Exempting just this one short-lived buffer keeps the fix local --
+every other approach changes dimming for all buffers. The cost is no
+focus cue on a split-displayed dashboard, accepted as a fair trade."
+ (equal (buffer-name buffer) "*dashboard*"))
+
(use-package auto-dim-other-buffers
:load-path "~/code/auto-dim-other-buffers.el"
:ensure nil
@@ -242,6 +255,8 @@ the fallback that makes vterm repaint after auto-dim changes window state."
(dupre-org-priority-b . (dupre-org-priority-b-dim . nil))
(dupre-org-priority-c . (dupre-org-priority-c-dim . nil))
(dupre-org-priority-d . (dupre-org-priority-d-dim . nil))))
+ (add-hook 'auto-dim-other-buffers-never-dim-buffer-functions
+ #'cj/auto-dim--never-dim-dashboard-p)
(auto-dim-other-buffers-mode 1))
(with-eval-after-load 'vterm