[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/corfu abe4a14d52 2/9: Add optional argument to hack red
From: |
ELPA Syncer |
Subject: |
[elpa] externals/corfu abe4a14d52 2/9: Add optional argument to hack redisplay when move the frame |
Date: |
Thu, 17 Nov 2022 14:57:28 -0500 (EST) |
branch: externals/corfu
commit abe4a14d520c9545f82c38c65ab17fbaca84591f
Author: Yuwei Tian <fishtai0@gmail.com>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Add optional argument to hack redisplay when move the frame
---
corfu.el | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/corfu.el b/corfu.el
index 0cb58762f9..9cf260a453 100644
--- a/corfu.el
+++ b/corfu.el
@@ -391,10 +391,14 @@ The completion backend can override this with
;; Function adapted from posframe.el by tumashu
(defvar x-gtk-resize-child-frames) ;; Not present on non-gtk builds
-(defun corfu--make-frame (frame params buffer x y width height)
+(defun corfu--make-frame (frame params buffer x y width height
+ &optional hack-redisplay-p)
"Make child frame from BUFFER and show it at X/Y with WIDTH/HEIGHT.
-PARAMS are frame parameters and FRAME is the existing frame."
+PARAMS are frame parameters and FRAME is the existing frame.
+
+If the optional argument HACK-REDISPLAY-P is non-nil,
+hack redisplay to avoid flicker."
(when corfu--frame-timer
(cancel-timer corfu--frame-timer)
(setq corfu--frame-timer nil))
@@ -450,8 +454,9 @@ PARAMS are frame parameters and FRAME is the existing
frame."
;; XXX HACK Avoid flicker when frame is already visible.
;; Redisplay, wait for resize and then move the frame.
(unless (equal (frame-position frame) (cons x y))
- (redisplay 'force)
- (sleep-for 0.01)
+ (when hack-redisplay-p
+ (redisplay 'force)
+ (sleep-for 0.01))
(set-frame-position frame x y))
;; XXX HACK: Force redisplay, otherwise the popup sometimes does not
;; display content.
@@ -504,7 +509,8 @@ A scroll bar is displayed from LO to LO+BAR."
lines "\n"))))
(setq corfu--frame
(corfu--make-frame corfu--frame corfu--frame-parameters buffer
- x y width height))))
+ x y width height
+ 'hack-redisplay))))
(defun corfu--hide-frame-deferred ()
"Deferred frame hiding."
- [elpa] externals/corfu updated (0d0b2c9fd9 -> ef048aeb01), ELPA Syncer, 2022/11/17
- [elpa] externals/corfu 6d010877f9 8/9: Increase corfu-doc-popup-delay, ELPA Syncer, 2022/11/17
- [elpa] externals/corfu abe4a14d52 2/9: Add optional argument to hack redisplay when move the frame,
ELPA Syncer <=
- [elpa] externals/corfu f434fed5f8 3/9: Add corfu-doc-popup, ELPA Syncer, 2022/11/17
- [elpa] externals/corfu 0632308f33 1/9: Make create buffer and make frame code reusable, ELPA Syncer, 2022/11/17
- [elpa] externals/corfu ef048aeb01 9/9: Remove corfu-doc-popup-transition, ELPA Syncer, 2022/11/17
- [elpa] externals/corfu 666678e7e9 7/9: Remove corfu-doc-popup group, ELPA Syncer, 2022/11/17
- [elpa] externals/corfu c63d92f141 4/9: Rename corfu-info to corfu-doc-buffer, ELPA Syncer, 2022/11/17
- [elpa] externals/corfu b02b68a2b8 6/9: Revert "Add optional argument to hack redisplay when move the frame", ELPA Syncer, 2022/11/17
- [elpa] externals/corfu 0438c9085d 5/9: Update README, ELPA Syncer, 2022/11/17