hlissner/emacs-solaire-mode

Dashboard png background conflicts with solaire mode

ianyepan opened this issue · 9 comments

This isn't that big of an issue, but solaire-mode fails to take into account the influence it has on the dashboard logo, considering dashboard a popular package. Notice the lighter square background around the Emacs logo. This happens on all themes. Attached are screenshots of Zenburn and Solarized Dark for your reference.

Screenshot 2019-07-22 at 10 29 18 AM

Screenshot 2019-07-22 at 10 28 41 AM

It appears to use the dashboard-banner-logo-title face for its background. Give this a try and let me know if it fixes its background:

(with-eval-after-load 'solaire-mode
  (add-to-list 'solaire-mode-remap-alist '((dashboard-banner-logo-title solaire-default-face) . t)))

Thanks for the prompt reply! I added your two-lines into my code snippet and it looks like this now:

(use-package solaire-mode
  :hook (((change-major-mode after-revert ediff-prepare-buffer) . turn-on-solaire-mode)
         (minibuffer-setup . solaire-mode-in-minibuffer))
  :config
  (with-eval-after-load 'solaire-mode
    (add-to-list 'solaire-mode-remap-alist '((dashboard-banner-logo-title solaire-default-face) . t)))
  (solaire-global-mode)
  (solaire-mode-swap-bg)
  (with-eval-after-load 'solaire-mode
    (add-to-list 'solaire-mode-remap-alist '((dashboard-banner-logo-title solaire-default-face) . t))))

(use-package dashboard
  :config
  (with-eval-after-load 'solaire-mode
    (add-to-list 'solaire-mode-remap-alist '((dashboard-banner-logo-title solaire-default-face) . t)))
  (dashboard-setup-startup-hook))

Just to be absolutely certain I added your code in under both the solaire mocde and dashboard config, before 'and' after calling solaire-global-mode. Unfortunately, the code doesn't seem to have an effect.

Ah, I think I see the issue. dashboard is loaded immediately and solaire-mode is deferred. That means by the time solaire-mode-swap-bg runs, the dashboard has already displayed the banner with the wrong background.

Try this out, instead:

 (use-package solaire-mode
   :hook (((change-major-mode after-revert ediff-prepare-buffer) . turn-on-solaire-mode)
          (minibuffer-setup . solaire-mode-in-minibuffer))
   :config
-  (with-eval-after-load 'solaire-mode
-    (add-to-list 'solaire-mode-remap-alist '((dashboard-banner-logo-title solaire-default-face) . t)))
   (solaire-global-mode)
   (solaire-mode-swap-bg)
-  (with-eval-after-load 'solaire-mode
-    (add-to-list 'solaire-mode-remap-alist '((dashboard-banner-logo-title solaire-default-face) . t))))
+  (with-eval-after-load 'dashboard
+    (set-face-background 'dashboard-banner-logo-title
+                         (face-background 'default nil t))))
 
 (use-package dashboard
   :config
-  (with-eval-after-load 'solaire-mode
-    (add-to-list 'solaire-mode-remap-alist '((dashboard-banner-logo-title solaire-default-face) . t)))
   (dashboard-setup-startup-hook))

Actually, now that I think about it, why couldn't we just set the background to nil? Try this:

 (use-package dashboard
   :config
+  (set-face-background 'dashboard-banner-logo-title nil)
   (dashboard-setup-startup-hook))

At the moment I'm using Emacs 26.2 on my machine and this problem does not appear. As suggested by other people I've asked over at Dashboard's repo, this issue only happens in Emacs-plus 27.

I'll try your solution when I get to my other machine and report back.

As of 2be8aa0 this should no longer be an issue. Let me know if that isn't the case and I'll reopen it. Thanks for bringing it to my attention!


The problem still exists on windows

@hlissner There is more discussion in the dashboard repo that this issue still exists, but only on windows

@Hxppdv Seems like an Emacs issue. Not sure there is anything that can be done on solaire-mode's end, unless I change it to aggresively redraw, which would be much too expensive a workaround. A workaround might be to disable solaire-mode in dashboard buffers. e.g.

(add-hook 'dashboard-mode-hook #'turn-off-solaire-mode)
(add-hook '+doom-dashboard-mode-hook #'turn-off-solaire-mode)

Or mark the dashboard as a real buffer:

(defun real-buffer-p ()
  (or (solaire-mode-real-buffer-p)
      (equal (buffer-name) "*dashboard*")))
(setq solaire-mode-real-buffer-fn #'real-buffer-p)