[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/posframe 981ab87 2/2: * posframe.el (posframe--create-p
From: |
ELPA Syncer |
Subject: |
[elpa] externals/posframe 981ab87 2/2: * posframe.el (posframe--create-posframe): Simplify border and background hack. |
Date: |
Tue, 26 Oct 2021 12:57:22 -0400 (EDT) |
branch: externals/posframe
commit 981ab87d11cd2c07db4980c8c7e5e4b87cf171fb
Author: Feng Shu <tumashu@163.com>
Commit: Feng Shu <tumashu@163.com>
* posframe.el (posframe--create-posframe): Simplify border and background
hack.
---
posframe.el | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/posframe.el b/posframe.el
index 1e62fe1..a641df0 100644
--- a/posframe.el
+++ b/posframe.el
@@ -267,19 +267,18 @@ ACCEPT-FOCUS."
(inhibit-double-buffering .
,posframe-inhibit-double-buffering)
;; Do not save child-frame when use desktop.el
(desktop-dont-save . t))))
- ;; HACK: Setting the same frame-parameter/face-background is
- ;; not a nop (BUG!). Check explicitly before applying the
- ;; setting. Without the check, the frame flickers on Mac.
(when border-color
- (let ((face (if (facep 'child-frame-border) 'child-frame-border
'internal-border)))
- (unless (equal (color-values (face-attribute face :background
posframe--frame 'default))
- (color-values border-color))
- (set-face-background face border-color posframe--frame))))
- ;; HACK: We have to apply the face background before adjusting
- ;; the frame parameter, otherwise the border is not updated
- ;; (BUG!).
- (set-frame-parameter posframe--frame 'background-color
- (face-attribute 'default :background
posframe--frame))
+ (set-face-background
+ (if (facep 'child-frame-border)
+ 'child-frame-border
+ 'internal-border)
+ border-color posframe--frame))
+ ;; HACK: Set face background after border color, otherwise the
+ ;; border is not updated (BUG!).
+ (when (version< emacs-version "28.0")
+ (set-frame-parameter
+ posframe--frame 'background-color
+ (face-attribute 'default :background posframe--frame)))
(let ((posframe-window (frame-root-window posframe--frame)))
;; This method is more stable than 'setq mode/header-line-format nil'
(unless respect-mode-line