emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/posframe 1d3cc43 1/2: Fix: internal-border-color doesn'


From: ELPA Syncer
Subject: [elpa] externals/posframe 1d3cc43 1/2: Fix: internal-border-color doesn't show immediately. #74
Date: Tue, 26 Oct 2021 12:57:22 -0400 (EDT)

branch: externals/posframe
commit 1d3cc437df51388d9cea98c47d82c94c665d40c4
Author: Feng Shu <tumashu@163.com>
Commit: Feng Shu <tumashu@163.com>

    Fix: internal-border-color doesn't show immediately. #74
    
    Thanks for the help of Daniel Mendler (@minad):
    
    
https://github.com/minad/corfu/blob/a881ca3e8d98b6c35c5ae3cba5fb8e7eb712db16/corfu.el#L345-L353
---
 posframe.el | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/posframe.el b/posframe.el
index 212641d..1e62fe1 100644
--- a/posframe.el
+++ b/posframe.el
@@ -267,10 +267,19 @@ 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
-          (set-face-background 'internal-border border-color posframe--frame)
-          (when (facep 'child-frame-border)
-            (set-face-background 'child-frame-border border-color 
posframe--frame)))
+          (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))
         (let ((posframe-window (frame-root-window posframe--frame)))
           ;; This method is more stable than 'setq mode/header-line-format nil'
           (unless respect-mode-line



reply via email to

[Prev in Thread] Current Thread [Next in Thread]