diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-26 07:47:03 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-26 07:47:03 -0500 |
| commit | f03e9d5384a9a6d1ff657cb1ffb413c18280e57e (patch) | |
| tree | d757c2259688a4b03a07eaebb16fdd36ea4a322e /tests | |
| parent | df4c2e290cb73df97ae163ac3abd1937baa466fa (diff) | |
| download | dotemacs-f03e9d5384a9a6d1ff657cb1ffb413c18280e57e.tar.gz dotemacs-f03e9d5384a9a6d1ff657cb1ffb413c18280e57e.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 'tests')
| -rw-r--r-- | tests/test-auto-dim-config.el | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/test-auto-dim-config.el b/tests/test-auto-dim-config.el index f33a475ab..4648f062c 100644 --- a/tests/test-auto-dim-config.el +++ b/tests/test-auto-dim-config.el @@ -132,5 +132,31 @@ '((term 25 97) (term 24 97)))))) +(ert-deftest test-auto-dim-config-never-dim-dashboard-exempts-dashboard () + "Normal: the *dashboard* buffer is exempt from dimming." + (skip-unless (file-directory-p test-auto-dim--fork)) + (require 'auto-dim-config) + (let* ((existed (get-buffer "*dashboard*")) + (buffer (or existed (get-buffer-create "*dashboard*")))) + (unwind-protect + (should (cj/auto-dim--never-dim-dashboard-p buffer)) + (unless existed (kill-buffer buffer))))) + +(ert-deftest test-auto-dim-config-never-dim-dashboard-near-miss-name-dims () + "Boundary: a buffer whose name only resembles the dashboard is not exempt." + (skip-unless (file-directory-p test-auto-dim--fork)) + (require 'auto-dim-config) + (let ((buffer (get-buffer-create "dashboard"))) + (unwind-protect + (should-not (cj/auto-dim--never-dim-dashboard-p buffer)) + (kill-buffer buffer)))) + +(ert-deftest test-auto-dim-config-never-dim-dashboard-other-buffer-dims () + "Error: an ordinary buffer is not exempt from dimming." + (skip-unless (file-directory-p test-auto-dim--fork)) + (require 'auto-dim-config) + (with-temp-buffer + (should-not (cj/auto-dim--never-dim-dashboard-p (current-buffer))))) + (provide 'test-auto-dim-config) ;;; test-auto-dim-config.el ends here |
