From 088bd387f6c901273ad166b67a14bf1745026c4f Mon Sep 17 00:00:00 2001 From: Liam Hupfer Date: Sat, 2 Sep 2023 11:44:48 -0500 Subject: [PATCH] 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 --- lisp/lib/ui.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/lib/ui.el b/lisp/lib/ui.el index 8d255255d..ea553c1d1 100644 --- a/lisp/lib/ui.el +++ b/lisp/lib/ui.el @@ -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