[Top][All Lists]

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

[elpa] externals/corfu 5824ef8 3/4: Another child frame bug, add comment

From: ELPA Syncer
Subject: [elpa] externals/corfu 5824ef8 3/4: Another child frame bug, add comment
Date: Fri, 16 Jul 2021 18:57:08 -0400 (EDT)

branch: externals/corfu
commit 5824ef853e8cde6beab8edf6e550680f894512cb
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Another child frame bug, add comment
 corfu.el | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/corfu.el b/corfu.el
index ebb1d21..2fe8f35 100644
--- a/corfu.el
+++ b/corfu.el
@@ -319,12 +319,19 @@ filter string with spaces is allowed."
                              . ,(alist-get 'child-frame-border-width 
-    (set-face-background
-     (if (facep 'child-frame-border) 'child-frame-border 'internal-border)
-     (face-attribute 'corfu-border :background) corfu--frame)
-    (set-frame-parameter
-     corfu--frame 'background-color
-     (face-attribute 'corfu-background :background))
+    ;; XXX HACK Setting the same frame-parameter/face-background is not a nop 
+    ;; Check explicitly before applying the setting.
+    ;; Without the check, the frame flickers on Mac.
+    ;; With the check, the inner frame sometimes does not get updated 
sometimes (BUG!).
+    (let* ((curr (frame-parameter corfu--frame 'background-color))
+          (new (face-attribute 'corfu-background :background)))
+      (unless (equal curr new)
+       (set-frame-parameter corfu--frame 'background-color new)))
+    (let* ((face (if (facep 'child-frame-border) 'child-frame-border 
+          (curr (face-attribute face :background corfu--frame))
+          (new (face-attribute 'corfu-border :background)))
+      (unless (equal curr new)
+       (set-face-background face new corfu--frame)))
     (set-window-buffer (frame-root-window corfu--frame) buffer)
     ;; XXX HACK Make the frame invisible before moving the popup from above to 
below the line in
     ;; order to avoid flicker.

reply via email to

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