[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/corfu a97fca9 5/6: child frame: Anti-flicker fix
From: |
Protesilaos Stavrou |
Subject: |
[elpa] externals/corfu a97fca9 5/6: child frame: Anti-flicker fix |
Date: |
Thu, 29 Apr 2021 13:38:53 -0400 (EDT) |
branch: externals/corfu
commit a97fca9d29669b69b576f35928c06639c25e222b
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
child frame: Anti-flicker fix
---
corfu.el | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/corfu.el b/corfu.el
index b6c3688..0780f71 100644
--- a/corfu.el
+++ b/corfu.el
@@ -183,10 +183,10 @@ Set to nil in order to disable confirmation."
(edge (window-inside-pixel-edges))
(lh (line-pixel-height))
(x (max 0 (min (+ (car edge) x -1) (- (frame-pixel-width) width))))
- (y (+ (cadr edge) y))
- (y (if (> (+ y height (* 3 lh)) (frame-pixel-height))
- (- y height 1)
- (+ y lh)))
+ (yb (+ (cadr edge) y lh))
+ (y (if (> (+ yb height lh lh) (frame-pixel-height))
+ (- yb height lh 1)
+ yb))
(buffer (get-buffer-create " *corfu*")))
(with-current-buffer buffer
(setq-local mode-line-format nil
@@ -238,8 +238,12 @@ Set to nil in order to disable confirmation."
(set-face-background 'internal-border (face-attribute 'corfu-border
:background) corfu--frame)
(set-frame-parameter corfu--frame 'background-color (face-attribute
'corfu-background :background))
(set-window-buffer (frame-root-window corfu--frame) buffer)
- (set-frame-position corfu--frame x y)
+ ;; XXX Make the frame invisible before moving the popup from above to below
+ ;; the line in order to avoid flicker.
+ (unless (eq (< (cdr (frame-position corfu--frame)) yb) (< y yb))
+ (make-frame-invisible corfu--frame))
(set-frame-size corfu--frame width height t)
+ (set-frame-position corfu--frame x y)
(make-frame-visible corfu--frame)))
(defun corfu--popup-show (pos lines &optional curr lo bar)
- [elpa] externals/corfu updated (f5b6c5d -> 17f3fc6), Protesilaos Stavrou, 2021/04/29
- [elpa] externals/corfu bed9513 4/6: Add corfu-min/max-width for easier customization, Protesilaos Stavrou, 2021/04/29
- [elpa] externals/corfu ec3e8cf 1/6: Print warning if corfu-mode is enabled on text display., Protesilaos Stavrou, 2021/04/29
- [elpa] externals/corfu 67be3fb 3/6: Add corfu-bar-width/corfu-margin-width customizable variables, Protesilaos Stavrou, 2021/04/29
- [elpa] externals/corfu 17f3fc6 6/6: Set child-frame-border on Emacs 28, Protesilaos Stavrou, 2021/04/29
- [elpa] externals/corfu a97fca9 5/6: child frame: Anti-flicker fix,
Protesilaos Stavrou <=
- [elpa] externals/corfu b8cd63f 2/6: Add error message when completion is already in progress, Protesilaos Stavrou, 2021/04/29