tweak(lib): add alpha-background support to opacity setter

This is preferred when available because it does not affect foreground
content like text and images.

Ref: https://git.savannah.gnu.org/cgit/emacs.git/tree/etc/NEWS?h=emacs-29.1#n801
This commit is contained in:
Liam Hupfer 2023-09-02 11:44:48 -05:00
parent d5f86f179f
commit 088bd387f6

View file

@ -177,9 +177,13 @@ Use `winner-undo' to undo this. Alternatively, use
OPACITY is an integer between 0 to 100, inclusive."
(interactive
(list (read-number "Opacity (0-100): "
(or (frame-parameter nil 'alpha)
(or (frame-parameter
nil (if (> emacs-major-version 28)
'alpha-background 'alpha))
100))))
(set-frame-parameter nil 'alpha opacity))
(set-frame-parameter nil (if (> emacs-major-version 28)
'alpha-background 'alpha)
opacity))
(defvar doom--narrowed-base-buffer nil)
;;;###autoload